Andrey Kovalev
3 years ago
1 changed files with 5 additions and 16 deletions
@ -1,24 +1,13 @@ |
|||||||
# Build container |
FROM golang:1.18 |
||||||
FROM golang:1.18-bullseye AS build |
|
||||||
|
|
||||||
# Set build workdir |
# Set app workdir |
||||||
WORKDIR /app |
WORKDIR /go/src/app |
||||||
|
|
||||||
# Copy app sources |
# Copy application sources |
||||||
COPY . . |
COPY . . |
||||||
|
|
||||||
# Build app |
# Build app |
||||||
RUN go build -o app . |
RUN go build -o app . |
||||||
|
|
||||||
# --- |
|
||||||
# Production container |
|
||||||
FROM debian:bullseye-slim |
|
||||||
|
|
||||||
# Set app workdir |
|
||||||
WORKDIR /app |
|
||||||
|
|
||||||
# Copy binary |
|
||||||
COPY --from=build /app/app . |
|
||||||
|
|
||||||
# Run app |
# Run app |
||||||
CMD ["./app"] |
CMD ["./app"] |
Loading…
Reference in new issue