feat: migrate runtime to postgresql
This commit is contained in:
+23
-1
@@ -1,4 +1,20 @@
|
||||
services:
|
||||
postgres:
|
||||
image: ${POSTGRES_IMAGE:-postgres:16-alpine}
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
POSTGRES_DB: ${POSTGRES_DB:-live_recorder}
|
||||
POSTGRES_USER: ${POSTGRES_USER:-live_recorder}
|
||||
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-change_me}
|
||||
volumes:
|
||||
- postgres-data:/var/lib/postgresql/data
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-live_recorder} -d ${POSTGRES_DB:-live_recorder}"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 10
|
||||
start_period: 10s
|
||||
|
||||
api:
|
||||
build:
|
||||
context: .
|
||||
@@ -8,10 +24,13 @@ services:
|
||||
DOTNET_SDK_IMAGE: ${DOTNET_SDK_IMAGE:-mcr.microsoft.com/dotnet/sdk:8.0-bookworm-slim}
|
||||
DOTNET_RUNTIME_IMAGE: ${DOTNET_RUNTIME_IMAGE:-mcr.microsoft.com/dotnet/aspnet:8.0-bookworm-slim}
|
||||
restart: unless-stopped
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
environment:
|
||||
ASPNETCORE_ENVIRONMENT: Production
|
||||
ASPNETCORE_URLS: http://+:8080
|
||||
ConnectionStrings__DefaultConnection: Data Source=/app/data/live-recorder.db
|
||||
ConnectionStrings__DefaultConnection: Host=postgres;Port=5432;Database=${POSTGRES_DB:-live_recorder};Username=${POSTGRES_USER:-live_recorder};Password=${POSTGRES_PASSWORD:-change_me}
|
||||
volumes:
|
||||
- ./data:/app/data
|
||||
- ./records:/app/records
|
||||
@@ -32,3 +51,6 @@ services:
|
||||
- api
|
||||
ports:
|
||||
- "${HTTP_PORT:-8080}:80"
|
||||
|
||||
volumes:
|
||||
postgres-data:
|
||||
|
||||
Reference in New Issue
Block a user