71 lines
1.9 KiB
YAML
71 lines
1.9 KiB
YAML
version: '3.8'
|
|
|
|
services:
|
|
db:
|
|
image: docker.arvancloud.ir/postgres:15-alpine
|
|
container_name: goldbank_db
|
|
environment:
|
|
POSTGRES_USER: ${POSTGRES_USER:-postgres}
|
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-postgres}
|
|
POSTGRES_DB: ${POSTGRES_DB:-goldbank}
|
|
ports:
|
|
- "${EXTERNAL_DB_PORT:-5432}:5432"
|
|
volumes:
|
|
- postgres_data:/var/lib/postgresql/data
|
|
restart: unless-stopped
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-postgres} -d ${POSTGRES_DB:-goldbank}"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 12
|
|
|
|
api:
|
|
build:
|
|
context: ./apps/api
|
|
dockerfile: Dockerfile
|
|
container_name: goldbank_api
|
|
# Prisma connects on module init, so a not-yet-ready DB crash-loops the API.
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
environment:
|
|
- DATABASE_URL=${DATABASE_URL:-postgresql://postgres:postgres@db:5432/goldbank?schema=public}
|
|
- PORT=${PORT:-3000}
|
|
# No host ports — Dokploy/Traefik routes by domain to container port 3000
|
|
expose:
|
|
- "3000"
|
|
restart: unless-stopped
|
|
# The bare name "api" is ambiguous on Dokploy's shared network (other stacks
|
|
# register it too), which made nginx dial the wrong containers. Use a unique alias.
|
|
networks:
|
|
default:
|
|
aliases:
|
|
- goldbank-api
|
|
|
|
admin-panel:
|
|
build:
|
|
context: ./apps/admin-panel
|
|
dockerfile: Dockerfile
|
|
container_name: goldbank_admin_panel
|
|
# No host ports — Dokploy/Traefik routes by domain to container port 80
|
|
expose:
|
|
- "80"
|
|
restart: unless-stopped
|
|
depends_on:
|
|
- api
|
|
|
|
user-app:
|
|
build:
|
|
context: ./apps/user-app
|
|
dockerfile: Dockerfile
|
|
container_name: goldbank_user_app
|
|
# No host ports — Dokploy/Traefik routes by domain to container port 80
|
|
expose:
|
|
- "80"
|
|
restart: unless-stopped
|
|
depends_on:
|
|
- api
|
|
|
|
volumes:
|
|
postgres_data:
|