mirror of
https://github.com/httpjamesm/AnonymousOverflow.git
synced 2025-04-19 21:39:24 +00:00
Switch to scratch on Dockerfile (#41)
This commit is contained in:
parent
669187dd4d
commit
f4ecc9be6a
1 changed files with 14 additions and 9 deletions
23
Dockerfile
23
Dockerfile
|
@ -1,19 +1,24 @@
|
|||
FROM golang:1.18-alpine
|
||||
|
||||
RUN apk add musl-dev
|
||||
RUN apk add libc-dev
|
||||
RUN apk add gcc
|
||||
FROM golang:1.19-alpine as build
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY go.mod ./
|
||||
COPY go.sum ./
|
||||
COPY go.mod .
|
||||
COPY go.sum .
|
||||
|
||||
RUN go mod download
|
||||
|
||||
COPY ./ /app
|
||||
COPY . .
|
||||
|
||||
RUN go build -o /anonymousoverflow
|
||||
ENV CGO_ENABLED=0
|
||||
|
||||
RUN go build -o anonymousoverflow
|
||||
|
||||
FROM scratch
|
||||
|
||||
COPY --from=build /app/anonymousoverflow /anonymousoverflow
|
||||
COPY templates /templates
|
||||
COPY public /public
|
||||
COPY --from=build /etc/ssl/certs /etc/ssl/certs
|
||||
|
||||
EXPOSE 8080
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue