Smaller docker image for deployment

This commit is contained in:
Dimitri Lozeve 2022-09-19 22:20:25 +02:00
parent 4516614a8b
commit c21bbbb559
2 changed files with 16 additions and 6 deletions

View file

@ -1,10 +1,20 @@
FROM gerbil/alpine
FROM gerbil/alpine as builder
RUN gxpkg install github.com/dlozeve/fancy
COPY . .
RUN ./build.ss lib
RUN ./build.ss server
RUN gxc -exe -static -cc-options -static -ld-options -lz -o server server.ss
FROM alpine:latest
RUN adduser -D appuser
# Copy the server binary
COPY --from=builder /src/server /
USER appuser
WORKDIR /home/appuser
EXPOSE 8080
CMD ["/src/server"]
CMD ["/server"]