lab2: PostgreSQL, sessions, compose, evidence tooling.
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:16.4-alpine
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
POSTGRES_USER: msg
|
||||
POSTGRES_DB: msg
|
||||
POSTGRES_PASSWORD_FILE: /run/secrets/pg_password
|
||||
secrets: [pg_password]
|
||||
volumes:
|
||||
- pgdata:/var/lib/postgresql/data
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U msg -d msg"]
|
||||
interval: 3s
|
||||
timeout: 3s
|
||||
retries: 20
|
||||
api:
|
||||
build: .
|
||||
restart: unless-stopped
|
||||
depends_on:
|
||||
postgres: {condition: service_healthy}
|
||||
environment:
|
||||
DATABASE_URL_FILE: /run/secrets/database_url
|
||||
SESSION_TTL_SECONDS: ${SESSION_TTL_SECONDS:-3600}
|
||||
APP_ENV: ${APP_ENV:-lab}
|
||||
secrets: [database_url]
|
||||
ports: ["127.0.0.1:8080:8080"]
|
||||
secrets:
|
||||
pg_password:
|
||||
file: ./secrets/pg_password
|
||||
database_url:
|
||||
file: ./secrets/database_url
|
||||
volumes:
|
||||
pgdata:
|
||||
Reference in New Issue
Block a user