diff --git a/Dockerfile b/Dockerfile index d2942be..2847fe0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,13 +1,13 @@ -FROM --platform=linux/amd64 registry.fedoraproject.org/fedora-minimal:37 +FROM --platform=linux/amd64 registry.fedoraproject.org/fedora-minimal:40 RUN microdnf install -y curl findutils gzip iputils less postgresql procps shadow-utils tar time which \ && microdnf clean all -RUN GRPC_HEALTH_PROBE_VERSION=v0.4.15 \ +RUN GRPC_HEALTH_PROBE_VERSION=v0.4.23 \ && curl -Lfso /bin/grpc_health_probe https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/${GRPC_HEALTH_PROBE_VERSION}/grpc_health_probe-linux-amd64 \ && chmod +x /bin/grpc_health_probe -RUN GO_MIGRATE_VERSION=v4.15.2 \ +RUN GO_MIGRATE_VERSION=v4.16.2 \ && curl -Lfso /tmp/migrate.tar.gz https://github.com/golang-migrate/migrate/releases/download/${GO_MIGRATE_VERSION}/migrate.linux-amd64.tar.gz \ && tar -xzf /tmp/migrate.tar.gz -C /bin \ && chmod +x /bin/migrate diff --git a/Makefile b/Makefile index ed7240c..2d3088b 100644 --- a/Makefile +++ b/Makefile @@ -25,7 +25,7 @@ SERVICE := $(PROJECT).server .PHONY: reset-db setup-local server server-profile install-js .PHONY: client-update client-large-update client-get client-rebuild client-rebuild-with-cache .PHONY: client-getcache client-gc-contents client-gc-project client-gc-random-projects -.PHONY: health upload-container-image gen-docs +.PHONY: health upload-container-image run-container gen-docs .PHONY: load-test-new load-test-get load-test-update install: @@ -201,6 +201,10 @@ else docker push gcr.io/gadget-core-production/dateilager:latest endif +run-container: release + docker build -t dl-local:latest . + docker run --rm -it -p 127.0.0.1:$(GRPC_PORT):$(GRPC_PORT)/tcp -v ./development:/home/main/secrets/tls -v ./development:/home/main/secrets/paseto dl-local:latest $(GRPC_PORT) "postgres://$(DB_USER):$(DB_PASS)@host.docker.internal:5432" dl + gen-docs: go run cmd/gen-docs/main.go diff --git a/entrypoint.sh b/entrypoint.sh index e4d0697..f6d6af6 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -2,6 +2,8 @@ set -euo pipefail +export DL_ENV="${DL_ENV:-dev}" + log() { echo "$(date +"%H:%M:%S") - $(printf '%s' "$@")" 1>&2 } @@ -16,7 +18,7 @@ error() { wait_for_postgres() { local dburi="${1}" - log "wait for postgres" + log "wait for postgres ${dburi}" until psql "${dburi}" -c '\q' 2> /dev/null; do sleep 1 @@ -74,7 +76,7 @@ main() { local secrets="${HOME}/secrets" log "start dateilager server" - "${HOME}/server" -dburi "${appdb}" -port "${port}" -log "${log_level}" -cert "${secrets}/server.crt" -key "${secrets}/server.key" -paseto "${secrets}/paseto.pub" + "${HOME}/server" --dburi "${appdb}" --port "${port}" --log-level "${log_level}" --cert "${secrets}/tls/server.crt" --key "${secrets}/tls/server.key" --paseto "${secrets}/paseto/paseto.pub" } main "$@"