From 883cd1f3c9c3efbdf31ddf92bf7cebfdc7cf49e4 Mon Sep 17 00:00:00 2001 From: Russia9 Date: Thu, 14 Apr 2022 02:05:14 +0300 Subject: [PATCH] a --- Dockerfile | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 8094e41..eb1b44f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,13 +1,24 @@ -FROM golang:1.18 +# Build container +FROM golang:1.18-bullseye AS build -# Set app workdir -WORKDIR /go/src/app +# Set build workdir +WORKDIR /app -# Copy application sources +# Copy app sources COPY . . # Build app -RUN go build -o app . +RUN go build -o bin . + +# --- +# Production container +FROM debian:bullseye-slim + +# Set app workdir +WORKDIR /app + +# Copy binary +COPY --from=build /app/bin . # Run app -CMD ["./app"] \ No newline at end of file +CMD ["./bin"]