Browse Source

Added Dockerfile

main
Horst Gutmann 1 year ago
parent
commit
8e6f5f71d7
No known key found for this signature in database GPG Key ID: 6F203F0D220F8E98
2 changed files with 23 additions and 0 deletions
  1. +2
    -0
      .dockerignore
  2. +21
    -0
      Dockerfile

+ 2
- 0
.dockerignore View File

@ -0,0 +1,2 @@
frontend/node_modules
bin

+ 21
- 0
Dockerfile View File

@ -0,0 +1,21 @@
FROM golang:1.13-alpine AS gobuilder
RUN apk add --no-cache gcc libc-dev
COPY . /src
WORKDIR /src/cmd/webmentiond
RUN go build
FROM node:12-alpine AS nodebuilder
COPY frontend /src/frontend
WORKDIR /src/frontend
RUN yarn && yarn run webpack
FROM alpine:3.11
VOLUME ["/data"]
RUN mkdir -p /var/lib/webmentiond/frontend
COPY pkg/server/migrations /var/lib/webmentiond/migrations
COPY --from=gobuilder /src/cmd/webmentiond/webmentiond /usr/local/bin/
COPY --from=nodebuilder /src/frontend/dist /var/lib/webmentiond/dist
COPY --from=nodebuilder /src/frontend/css /var/lib/webmentiond/css
COPY --from=nodebuilder /src/frontend/index.html /var/lib/webmentiond/
WORKDIR /var/lib/webmentiond
ENTRYPOINT ["/usr/local/bin/webmentiond", "serve", "--database-migrations", "/var/lib/webmentiond/migrations", "--database", "/data/webmentiond.sqlite"]

Loading…
Cancel
Save