diff --git a/Dockerfile b/Dockerfile index 9719b70..0f07fcb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,16 +18,16 @@ RUN useradd --create-home --home-dir /gorb gorb USER gorb -ENV DATABASE_USERNAME="gorb" \ -DATABASE_PASSWORD="gorb" \ -DATABASE="gorb" \ -DATABASE_HOST="database" \ -DATABASE_PORT="5432" \ -CACHE_DB_HOST="valkey" \ -CACHE_DB_PORT="6379" \ -BUNNY_API_KEY="your_storage_zone_password_here" \ -BUNNY_ENDPOINT="Frankfurt" \ -BUNNY_ZONE="gorb" \ -BUNNY_CDN_URL="https://cdn.gorb.app" +ENV DATABASE_USERNAME=gorb \ +DATABASE_PASSWORD=gorb \ +DATABASE=gorb \ +DATABASE_HOST=database \ +DATABASE_PORT=5432 \ +CACHE_DB_HOST=valkey \ +CACHE_DB_PORT=6379 \ +BUNNY_API_KEY=your_storage_zone_password_here \ +BUNNY_ENDPOINT=Frankfurt \ +BUNNY_ZONE=gorb \ +BUNNY_CDN_URL=https://cdn.gorb.app ENTRYPOINT ["/usr/bin/entrypoint.sh"] diff --git a/compose.dev.yml b/compose.dev.yml index 24b3997..3da7c89 100644 --- a/compose.dev.yml +++ b/compose.dev.yml @@ -23,10 +23,10 @@ services: - DATABASE=gorb - DATABASE_HOST=database - DATABASE_PORT=5432 - - BUNNY_API_KEY="your_storage_zone_password_here" - - BUNNY_ENDPOINT="Frankfurt" - - BUNNY_ZONE="gorb" - - BUNNY_CDN_URL="https://cdn.gorb.app" + - BUNNY_API_KEY=your_storage_zone_password_here + - BUNNY_ENDPOINT=Frankfurt + - BUNNY_ZONE=gorb + - BUNNY_CDN_URL=https://cdn.gorb.app database: image: postgres:16 restart: always diff --git a/compose.yml b/compose.yml index 4f0f543..f87411a 100644 --- a/compose.yml +++ b/compose.yml @@ -21,10 +21,10 @@ services: - DATABASE=gorb - DATABASE_HOST=database - DATABASE_PORT=5432 - - BUNNY_API_KEY="your_storage_zone_password_here" - - BUNNY_ENDPOINT="Frankfurt" - - BUNNY_ZONE="gorb" - - BUNNY_CDN_URL="https://cdn.gorb.app" + - BUNNY_API_KEY=your_storage_zone_password_here + - BUNNY_ENDPOINT=Frankfurt + - BUNNY_ZONE=gorb + - BUNNY_CDN_URL=https://cdn.gorb.app database: image: postgres:16 restart: always diff --git a/entrypoint.sh b/entrypoint.sh index 8bd8a44..a29e6bb 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -49,4 +49,7 @@ rotate_log() { rotate_log "/gorb/logs/backend.log" +# Give the DB time to start up before connecting +sleep 5 + /usr/bin/gorb-backend --config /gorb/config/config.toml 2>&1 | tee /gorb/logs/backend.log diff --git a/run-dev.sh b/run-dev.sh index 69067b8..242ca72 100755 --- a/run-dev.sh +++ b/run-dev.sh @@ -3,7 +3,7 @@ podman-compose --file compose.dev.yml up --build echo "SHUTTING DOWN CONTAINERS" -podman container stop backend_backend_1 backend_database_1 +podman container stop backend_backend_1 backend_database_1 backend_valkey_1 echo "DELETING CONTAINERS" -podman container rm backend_backend_1 backend_database_1 +podman container rm backend_backend_1 backend_database_1 backend_valkey_1