highscore-server/Dockerfile
Manuel 7749b7c159
Several improvements
* Make Dockerfile build and run correctly on alpine, fix missing sqlite
* Make config shared to avoid reading from file on each request
* Correctly handle Signals to gracefully stop database connection and
  to speed up shutdown, relevant for docker deployment
* Correctly check for sqlite error on table creation
2023-01-10 11:00:00 +01:00

15 lines
310 B
Docker

FROM thevlang/vlang:alpine AS build
WORKDIR /tmp/app
COPY . .
RUN v -prod -o highscore-server .
FROM alpine:latest
RUN apk --no-cache add sqlite-dev
WORKDIR /app
COPY --from=build /tmp/app/highscore-server .
COPY --from=build /tmp/app/config.example.toml ./config.toml
ENTRYPOINT [ "./highscore-server" ]