2023-07-04 11:03:32 +00:00
|
|
|
version: "3.8"
|
|
|
|
|
|
|
|
services:
|
2023-07-04 19:03:37 +00:00
|
|
|
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
|
|
|
|
|
2023-07-04 11:03:32 +00:00
|
|
|
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'
|
2023-07-04 18:54:54 +00:00
|
|
|
healthcheck:
|
2023-07-04 19:03:37 +00:00
|
|
|
test: ["CMD", "pg_isready", "-U", "${POSTGRES_USER:-postgres}"]
|
2023-07-04 18:54:54 +00:00
|
|
|
interval: 30s
|
2023-07-04 19:03:37 +00:00
|
|
|
retries: 5
|
2023-07-04 11:03:32 +00:00
|
|
|
|
|
|
|
volumes:
|
|
|
|
db_data:
|