2024-06-11 08:48:49 +02:00
|
|
|
FROM golang:1.22-alpine
|
|
|
|
|
2024-06-11 09:53:37 +02:00
|
|
|
ENV USER=cert400
|
|
|
|
ENV GROUPNAME=$USER
|
|
|
|
ENV UID=1000
|
|
|
|
ENV GID=1000
|
|
|
|
ENV APP_HOME="/home/cert400/app"
|
2024-06-11 08:48:49 +02:00
|
|
|
|
2024-06-11 09:53:37 +02:00
|
|
|
RUN addgroup --gid "$GID" "$GROUPNAME"
|
|
|
|
RUN adduser --gecos "" --disabled-password --ingroup "$GROUPNAME" --uid "$UID" "$USER"
|
2024-06-11 08:48:49 +02:00
|
|
|
|
2024-06-11 09:53:37 +02:00
|
|
|
RUN mkdir "$APP_HOME"
|
|
|
|
|
|
|
|
ADD . "$APP_HOME"
|
|
|
|
|
|
|
|
WORKDIR "$APP_HOME"
|
2024-06-11 08:48:49 +02:00
|
|
|
|
|
|
|
RUN go build -o main .
|
|
|
|
|
2025-01-08 11:29:09 +01:00
|
|
|
USER cert400
|
|
|
|
|
2024-06-11 09:53:37 +02:00
|
|
|
CMD ["./main", "server"]
|