tiamat/Dockerfile

23 lines
373 B
Docker
Raw Normal View History

2024-06-10 12:43:26 +02:00
FROM golang:1.22-alpine
ENV USER=tiamat
ENV GROUPNAME=$USER
ENV UID=1000
ENV GID=1000
ENV APP_HOME="/home/tiamat/app"
2024-06-10 12:43:26 +02:00
RUN addgroup --gid "$GID" "$GROUPNAME"
RUN adduser --gecos "" --disabled-password --ingroup "$GROUPNAME" --uid "$UID" "$USER"
2024-06-10 12:43:26 +02:00
USER "$USER"
RUN mkdir "$APP_HOME"
ADD . "$APP_HOME"
WORKDIR "$APP_HOME"
2024-06-10 12:43:26 +02:00
RUN go build -o main .
CMD ["./main", "server"]