70 lines
1.9 KiB
YAML
70 lines
1.9 KiB
YAML
services:
|
|
postgres:
|
|
image: postgres:15-alpine
|
|
environment:
|
|
POSTGRES_DB: ${POSTGRES_DB:-estate_platform}
|
|
POSTGRES_USER: ${POSTGRES_USER:-postgres}
|
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-postgres}
|
|
volumes:
|
|
- postgres_data:/var/lib/postgresql/data
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-postgres}"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
restart: unless-stopped
|
|
networks:
|
|
- internal
|
|
|
|
redis:
|
|
image: redis:7-alpine
|
|
volumes:
|
|
- redis_data:/data
|
|
command: redis-server --appendonly yes --requirepass ${REDIS_PASSWORD:-redis_password}
|
|
healthcheck:
|
|
test: ["CMD", "redis-cli", "--raw", "incr", "ping"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
restart: unless-stopped
|
|
networks:
|
|
- internal
|
|
|
|
web:
|
|
build: .
|
|
env_file:
|
|
- .env
|
|
environment:
|
|
DATABASE_URL: postgresql://${POSTGRES_USER:-postgres}:${POSTGRES_PASSWORD:-postgres}@postgres:5432/${POSTGRES_DB:-estate_platform}?connection_limit=10&pool_timeout=10
|
|
REDIS_URL: redis://:${REDIS_PASSWORD:-redis_password}@redis:6379
|
|
volumes:
|
|
- appdata:/app/data
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
redis:
|
|
condition: service_healthy
|
|
restart: unless-stopped
|
|
networks:
|
|
- internal
|
|
- traefik
|
|
labels:
|
|
- "traefik.enable=true"
|
|
- "traefik.http.routers.estate-platform.rule=Host(`${APP_DOMAIN:-estate.localhost}`)"
|
|
- "traefik.http.routers.estate-platform.entrypoints=websecure"
|
|
- "traefik.http.routers.estate-platform.tls=true"
|
|
- "traefik.http.routers.estate-platform.tls.certresolver=letsencrypt"
|
|
- "traefik.http.services.estate-platform.loadbalancer.server.port=3000"
|
|
- "traefik.docker.network=traefik"
|
|
|
|
networks:
|
|
traefik:
|
|
external: true
|
|
internal:
|
|
driver: bridge
|
|
|
|
volumes:
|
|
appdata:
|
|
postgres_data:
|
|
redis_data:
|