Files
global_it24_landing/docker-compose.yml
DeepAgent c5f3377a62 Add PostgreSQL configuration and database management tools
- Added PostgreSQL service to docker-compose.yml
- Updated .env.example with complete database settings
- Created DATABASE.md with comprehensive PostgreSQL guide
- Added backup-db.sh script for automatic database backups
- Configured health checks for both PostgreSQL and app containers
- Added Docker network for secure container communication
2025-10-27 11:45:42 +00:00

69 lines
1.9 KiB
YAML
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
version: '3.8'
services:
postgres:
image: postgres:16-alpine
container_name: global-it24-postgres
restart: unless-stopped
environment:
POSTGRES_USER: ${POSTGRES_USER:-globalit24}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-changeme123}
POSTGRES_DB: ${POSTGRES_DB:-globalit24_db}
PGDATA: /var/lib/postgresql/data/pgdata
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-globalit24}"]
interval: 10s
timeout: 5s
retries: 5
networks:
- app-network
global-it24-web:
build:
context: .
dockerfile: Dockerfile
args:
NEXT_PUBLIC_SITE_URL: ${NEXT_PUBLIC_SITE_URL:-https://video.mscsrv.ru}
container_name: global-it24-landing
restart: unless-stopped
ports:
- "3000:3000"
depends_on:
postgres:
condition: service_healthy
environment:
- NODE_ENV=production
- NEXT_PUBLIC_SITE_URL=${NEXT_PUBLIC_SITE_URL:-https://video.mscsrv.ru}
- DATABASE_URL=postgresql://${POSTGRES_USER:-globalit24}:${POSTGRES_PASSWORD:-changeme123}@postgres:5432/${POSTGRES_DB:-globalit24_db}
- SMTP_HOST=${SMTP_HOST}
- SMTP_PORT=${SMTP_PORT:-465}
- SMTP_USER=${SMTP_USER}
- SMTP_PASSWORD=${SMTP_PASSWORD}
- NOTIFICATION_EMAIL=${NOTIFICATION_EMAIL}
- TELEGRAM_BOT_TOKEN=${TELEGRAM_BOT_TOKEN}
- TELEGRAM_CHAT_ID=${TELEGRAM_CHAT_ID}
- PORT=3000
- HOSTNAME=0.0.0.0
healthcheck:
test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost:3000/"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
networks:
- app-network
networks:
app-network:
driver: bridge
volumes:
postgres_data:
driver: local
# Для работы с внешним Traefik:
# Traefik будет обращаться к контейнеру по IP хоста на порту 3000