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
This commit is contained in:
Manuel 2023-01-10 11:00:00 +01:00
parent c03f949344
commit 7749b7c159
Signed by: Manuel
GPG key ID: 4085037435E1F07A
5 changed files with 59 additions and 19 deletions

View file

@ -2,10 +2,12 @@ FROM thevlang/vlang:alpine AS build
WORKDIR /tmp/app
COPY . .
RUN v -prod .
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