Archived
Template
1
0
This repository has been archived on 2023-12-20. You can view files and clone it, but cannot push or open issues or pull requests.
Files
golang-base-project/Dockerfile

23 lines
528 B
Docker
Raw Permalink Normal View History

2021-12-12 14:56:13 +01:00
FROM golang:1.16.5-alpine AS builder
WORKDIR /app
COPY . .
RUN apk add --update nodejs npm
RUN apk --no-cache add ca-certificates
RUN npm install
RUN npm run build
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o "main" -ldflags="-w -s" ./cmd/base/main.go
FROM scratch
2022-01-29 10:21:05 +01:00
WORKDIR /app
COPY --from=builder /app/active.en.toml /app/active.en.toml
COPY --from=builder /app/active.sv.toml /app/active.sv.toml
2021-12-12 14:56:13 +01:00
COPY --from=builder /app/main /usr/bin/
COPY --from=builder /etc/ssl/certs/ /etc/ssl/certs/
CMD ["main"]
EXPOSE 80