Docker compose

This commit is contained in:
Eden Kirin
2024-01-13 20:17:27 +01:00
parent 59252abafb
commit d698a6a0aa
4 changed files with 78 additions and 0 deletions

20
machines/Dockerfile Normal file
View File

@ -0,0 +1,20 @@
# stage 2: build golang backend
FROM golang:1.21-alpine3.19 as go-builder
WORKDIR /go-builder
COPY . .
RUN \
go mod download && \
go mod verify && \
go build -v -ldflags "-s -w" -o machines-app ./app/main.go
# stage 2: build final container
FROM alpine:3.19
USER $USER
WORKDIR /app
COPY --from=go-builder /go-builder/machines-app /app
ENTRYPOINT ["/app/machines-app"]