open-law/docker-compose.yml

40 lines
955 B
YAML

version: "3.8"
services:
app:
build: .
# restart: always
command: sh ./start_server.sh
env_file: ./project.env
depends_on:
- db
ports:
- '127.0.0.1:${LOCAL_WEB_PORT:-8000}:${LOCAL_WEB_PORT:-8000}'
healthcheck:
test: ["CMD", "wget", "-qO-", "http://localhost:${LOCAL_WEB_PORT:-8000}/health"]
interval: 30s
timeout: 10s
retries: 3
db:
image: postgres:14
restart: always
volumes:
- db_data:/var/lib/postgresql/data
environment:
POSTGRES_USER: ${POSTGRES_USER:-postgres}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-passwd}
POSTGRES_DB: db
PGDATABASE: db
PGPASSWORD: ${POSTGRES_PASSWORD:-passwd}
PGUSER: ${POSTGRES_USER:-postgres}
ports:
- '127.0.0.1:${LOCAL_DB_PORT:-15432}:5432'
healthcheck:
test: ["CMD", "pg_isready", "-U", "${POSTGRES_USER:-postgres}"]
interval: 30s
retries: 5
volumes:
db_data: