Add docker file
This commit is contained in:
parent
1e60fdb8ff
commit
8bfbb0f040
1 changed files with 27 additions and 0 deletions
27
Dockerfile
Normal file
27
Dockerfile
Normal file
|
@ -0,0 +1,27 @@
|
|||
# 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/
|
||||
COPY ./well-known/ ./well-known/
|
||||
COPY ./static/ ./static/
|
||||
COPY humans.txt ./
|
||||
COPY robots.txt ./
|
||||
|
||||
RUN CGO_ENABLED=0 GOOS=linux go build -o /mstar
|
||||
|
||||
FROM gcr.io/distroless/base-debian11 AS build-release-stage
|
||||
|
||||
WORKDIR /
|
||||
|
||||
COPY --from=build-stage /mstar /mstar
|
||||
|
||||
EXPOSE 8080
|
||||
|
||||
USER nonroot:nonroot
|
||||
|
||||
ENTRYPOINT [ "/mstar" ]
|
Loading…
Reference in a new issue