Skip to content

Commit

Permalink
Add Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
mcorbin committed Jun 2, 2024
1 parent 1295046 commit 630076b
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
FROM golang:1.22.3 as build-env

ADD . /app
WORKDIR /app

RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -mod vendor

# -----------------------------------------------------------------------------

FROM alpine:3.19.0

RUN addgroup -S -g 10000 server \
&& adduser -S -D -u 10000 -s /sbin/nologin -G server server

RUN mkdir /app
RUN chown -R 10000:10000 /app

USER 10000

COPY --from=build-env /app/server /app/server
COPY ./assets /app/assets
COPY ./dev/migrations /app/migrations

ENTRYPOINT ["/app/server"]
CMD ["server", "--config", "/config.yaml"]

0 comments on commit 630076b

Please sign in to comment.