Andrey Kovalev
3 years ago
1 changed files with 20 additions and 6 deletions
@ -1,10 +1,24 @@ |
|||||||
FROM alpine:3.11.6 AS build |
# Build container |
||||||
RUN apk add --no-cache go |
FROM golang:1.17-bullseye AS build |
||||||
|
|
||||||
|
# Set build workdir |
||||||
WORKDIR /app |
WORKDIR /app |
||||||
|
|
||||||
|
# Copy app sources |
||||||
COPY . . |
COPY . . |
||||||
RUN CGO_ENABLED=1 GOOS=linux go build -o app -tags musl cw-deals-watcher |
|
||||||
|
|
||||||
FROM alpine:3.11.6 |
# Build app |
||||||
|
RUN go build -o app . |
||||||
|
|
||||||
|
# --- |
||||||
|
# Production container |
||||||
|
FROM debian:bullseye-slim |
||||||
|
|
||||||
|
# Set app workdir |
||||||
WORKDIR /app |
WORKDIR /app |
||||||
COPY --from=build /app/app /app/app |
|
||||||
CMD ["/app/app"] |
# Copy binary |
||||||
|
COPY --from=build /app/app . |
||||||
|
|
||||||
|
# Run app |
||||||
|
CMD ["./app"] |
||||||
|
Loading…
Reference in new issue