Browse Source

a

master
Andrey Kovalev 3 years ago
parent
commit
883cd1f3c9
Signed by: Russia9
GPG Key ID: EC3AA65373CA51DC
  1. 23
      Dockerfile

23
Dockerfile

@ -1,13 +1,24 @@ @@ -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"]
CMD ["./bin"]

Loading…
Cancel
Save