add dockerfile to build into container
This commit is contained in:
parent
7270bd057e
commit
8fc7c6d57a
1 changed files with 23 additions and 0 deletions
23
Dockerfile
Normal file
23
Dockerfile
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
# syntax=docker/dockerfile:1
|
||||||
|
FROM golang:1.21 AS build-stage
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
COPY go.mod ./
|
||||||
|
RUN go mod download
|
||||||
|
|
||||||
|
COPY *.go ./
|
||||||
|
COPY ./templates/ ./templates/
|
||||||
|
|
||||||
|
RUN CGO_ENABLED=0 GOOS=linux go build -o /evilthings
|
||||||
|
|
||||||
|
FROM gcr.io/distroless/base-debian11 AS build-release-stage
|
||||||
|
|
||||||
|
WORKDIR /
|
||||||
|
|
||||||
|
COPY --from=build-stage /evilthings /evilthings
|
||||||
|
|
||||||
|
EXPOSE 8080
|
||||||
|
|
||||||
|
USER nonroot:nonroot
|
||||||
|
|
||||||
|
ENTRYPOINT [ "/evilthings" ]
|
Loading…
Reference in a new issue