version: '3.9' services: # ── Frontend (React) ─────────────────────────────────────────────────────── frontend: build: context: . dockerfile: Dockerfile container_name: hotelsync-frontend restart: unless-stopped networks: - hotelsync-net # ── API (Node.js — placeholder, будет добавлен позже) ───────────────────── # api: # build: ./api # container_name: hotelsync-api # env_file: .env # depends_on: [postgres, redis] # networks: [hotelsync-net] # ── PostgreSQL ───────────────────────────────────────────────────────────── postgres: image: postgres:16-alpine container_name: hotelsync-postgres restart: unless-stopped env_file: .env environment: POSTGRES_DB: ${POSTGRES_DB:-hotelsync} POSTGRES_USER: ${POSTGRES_USER:-hotelsync} POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} volumes: - postgres_data:/var/lib/postgresql/data networks: - hotelsync-net # ── Redis ────────────────────────────────────────────────────────────────── redis: image: redis:7-alpine container_name: hotelsync-redis restart: unless-stopped command: redis-server --requirepass ${REDIS_PASSWORD} volumes: - redis_data:/data networks: - hotelsync-net # ── Nginx (reverse proxy + SSL) ──────────────────────────────────────────── nginx: image: nginx:alpine container_name: hotelsync-nginx restart: unless-stopped ports: - "80:80" - "443:443" volumes: - ./deploy/nginx/nginx.conf:/etc/nginx/nginx.conf:ro - ./deploy/nginx/conf.d:/etc/nginx/conf.d:ro - certbot_www:/var/www/certbot:ro - certbot_certs:/etc/letsencrypt:ro depends_on: - frontend networks: - hotelsync-net # ── Certbot (SSL Let's Encrypt) ──────────────────────────────────────────── certbot: image: certbot/certbot container_name: hotelsync-certbot volumes: - certbot_www:/var/www/certbot - certbot_certs:/etc/letsencrypt entrypoint: "/bin/sh -c 'trap exit TERM; while :; do certbot renew; sleep 12h & wait $${!}; done;'" volumes: postgres_data: redis_data: certbot_www: certbot_certs: networks: hotelsync-net: driver: bridge