From 6cd450842879575b1d22f9e2e87d3e0d57eaebd1 Mon Sep 17 00:00:00 2001 From: Christopher Bross Date: Sun, 20 Dec 2020 01:17:38 +0100 Subject: [PATCH] new docker file --- Dockerfile | 41 +++++++++-------------------------------- 1 file changed, 9 insertions(+), 32 deletions(-) diff --git a/Dockerfile b/Dockerfile index 217e799..e01bc9f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,36 +1,13 @@ -FROM golang:alpine as builder +FROM nginx:alpine -RUN apk --no-cache add --update \ - gcc \ - musl-dev \ - git \ - ca-certificates -WORKDIR /go/src/gitea.ckris.de/titzi/anmeldeportal_hochzeit -RUN CGO_ENABLED=1 go get -d -v github.com/mattn/go-sqlite3 -COPY backend/go/src/server/main.go . -RUN CGO_ENABLED=1 GOOS=linux go build -a -installsuffix cgo -o backend . +COPY frontend/assets /usr/share/nginx/html/assets/ +COPY frontend/css /usr/share/nginx/html/css/ +COPY frontend/js /usr/share/nginx/html/js/ +COPY frontend/index.html /usr/share/nginx/html/ - - -FROM alpine:latest - -RUN apk --no-cache add --update \ - gcc \ - musl-dev - -WORKDIR /go/ - -COPY --from=builder /go/src/gitea.ckris.de/titzi/anmeldeportal_hochzeit/backend . -COPY frontend/assets ./frontend/assets/ -COPY frontend/js ./frontend/js/ -COPY frontend/css ./frontend/css/ -COPY frontend/index.html ./frontend/ - -RUN addgroup -g 3333 -S go && \ - adduser -h /go -u 3333 -G go -S go && \ - chown -R go:go . -USER go +RUN addgroup -g 3333 -S web && \ + adduser -h /web -u 3333 -G web -S web && \ + chown -R web:web . +USER web EXPOSE 8080 - -CMD ["./backend"] \ No newline at end of file