2 changed files with 38 additions and 1 deletions
@ -0,0 +1,36 @@ |
|||||||
|
FROM golang:alpine as builder |
||||||
|
|
||||||
|
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 . |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
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 |
||||||
|
|
||||||
|
EXPOSE 8080 |
||||||
|
|
||||||
|
CMD ["./backend"] |
||||||
Loading…
Reference in new issue