Files
trading_assistant/trading_assistant_api/services/docker-compose.yml
2026-02-10 10:44:54 +08:00

60 lines
1.4 KiB
YAML

version: "3.9"
services:
postgres:
image: postgres:18.1-alpine
container_name: api_postgres
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres123123
POSTGRES_DB: postgres
ports:
- "5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres -d postgres"]
interval: 5s
timeout: 5s
retries: 20
volumes:
- ./shared_data/db/:/var/lib/postgresql/data
- ../services/user/db/schema.sql:/docker-entrypoint-initdb.d/10_user_schema.sql:ro
user:
build:
context: ..
dockerfile: services/user/Dockerfile
image: user-service:latest
container_name: user_service
environment:
PG_HOST: postgres
PG_PORT: "5432"
PG_USER: postgres
PG_PASSWORD: postgres123123
PG_DBNAME: postgres
PG_SSLMODE: disable
MIGRATE_ON_START: "0"
PORT: "8080"
JWT_SECRET: "change_me_dev_secret"
JWT_TTL: "24h"
ports:
- "8080:8080"
depends_on:
postgres:
condition: service_healthy
restart: unless-stopped
# country:
# build:
# context: ..
# dockerfile: services/country/Dockerfile
# image: country-service:latest
# container_name: country_service
# environment:
# PORT: "8081"
# ports:
# - "8081:8081"
# restart: unless-stopped
volumes:
pgdata: