Compare commits
2 Commits
7b340cc6f4
...
a23642af34
Author | SHA1 | Date |
---|---|---|
Nicolas Froger | a23642af34 | |
Nicolas Froger | d252f53a6f |
|
@ -1,7 +1,4 @@
|
||||||
.vscode
|
.vscode
|
||||||
.git
|
.git
|
||||||
go.mod
|
|
||||||
go.sum
|
|
||||||
*.go
|
|
||||||
helm
|
helm
|
||||||
.*ignore
|
.*ignore
|
||||||
|
|
24
Dockerfile
24
Dockerfile
|
@ -1,19 +1,35 @@
|
||||||
FROM alpine:3.11.6
|
FROM golang:1.18.5 as builder
|
||||||
|
|
||||||
ARG GOOS="linux"
|
ARG GOOS="linux"
|
||||||
ARG GOARCH="amd64"
|
ARG GOARCH="amd64"
|
||||||
|
|
||||||
|
WORKDIR /workspace
|
||||||
|
|
||||||
|
COPY go.mod go.sum /workspace/
|
||||||
|
|
||||||
|
RUN go mod download
|
||||||
|
|
||||||
|
COPY . .
|
||||||
|
RUN CGO_ENABLED=0 go build -a -o hugo-mx-gateway
|
||||||
|
|
||||||
|
|
||||||
|
FROM alpine:3.16.2
|
||||||
|
|
||||||
ARG RUNTIME_USER="mxgateway"
|
ARG RUNTIME_USER="mxgateway"
|
||||||
ARG RUNTIME_USER_UID=4583
|
ARG RUNTIME_USER_UID=4583
|
||||||
|
|
||||||
|
RUN apk update && apk add --no-cache ca-certificates
|
||||||
|
|
||||||
RUN addgroup -g $RUNTIME_USER_UID $RUNTIME_USER && \
|
RUN addgroup -g $RUNTIME_USER_UID $RUNTIME_USER && \
|
||||||
adduser --disabled-password --no-create-home --gecos "" \
|
adduser --disabled-password --no-create-home --gecos "" \
|
||||||
--home /app --ingroup $RUNTIME_USER --uid $RUNTIME_USER_UID $RUNTIME_USER
|
--home /app --ingroup $RUNTIME_USER --uid $RUNTIME_USER_UID $RUNTIME_USER
|
||||||
|
|
||||||
COPY entrypoint.sh bin/hugo-mx-gateway LICENSE /app/
|
WORKDIR /app
|
||||||
|
|
||||||
|
COPY --from=builder /workspace/hugo-mx-gateway .
|
||||||
|
COPY entrypoint.sh LICENSE /app/
|
||||||
COPY templates /app/templates
|
COPY templates /app/templates
|
||||||
|
|
||||||
RUN chown -R $RUNTIME_USER:$RUNTIME_USER /app
|
RUN chown -R $RUNTIME_USER:$RUNTIME_USER /app
|
||||||
|
|
||||||
WORKDIR /app
|
|
||||||
ENTRYPOINT ["sh", "./entrypoint.sh"]
|
ENTRYPOINT ["sh", "./entrypoint.sh"]
|
||||||
|
|
Loading…
Reference in New Issue