cert400/Dockerfile

23 lines
375 B
Docker
Raw Permalink Normal View History

2024-06-11 08:48:49 +02:00
FROM golang:1.22-alpine
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
RUN addgroup --gid "$GID" "$GROUPNAME"
RUN adduser --gecos "" --disabled-password --ingroup "$GROUPNAME" --uid "$UID" "$USER"
2024-06-11 08:48:49 +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 .
USER cert400
CMD ["./main", "server"]