aboutsummaryrefslogtreecommitdiffstats
path: root/Dockerfile
diff options
context:
space:
mode:
Diffstat (limited to 'Dockerfile')
-rw-r--r--Dockerfile16
1 files changed, 9 insertions, 7 deletions
diff --git a/Dockerfile b/Dockerfile
index d5f86a1..bc5197e 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,10 +1,12 @@
-FROM golang:alpine
+FROM golang:alpine as build
-WORKDIR /app
+WORKDIR /
-COPY go.mod ./
-RUN go mod download && go mod verify
COPY . .
-RUN go build -v -o /usr/local/bin/app ./cmd/dbasik-api
-CMD ["app"]
-EXPOSE 5000
+
+RUN go build -o ./app ./cmd/dbasik-api
+
+FROM scratch
+COPY --from=build /app /app
+COPY --from=build /.env /.env
+CMD ["/app"]