version: '3.8' services: # ─── База даних ─────────────────────────────────────────────── postgres: image: postgres:16-alpine container_name: shumiland-postgres restart: unless-stopped environment: POSTGRES_USER: ${POSTGRES_USER:-shumiland} POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-shumiland_secret} POSTGRES_DB: ${POSTGRES_DB:-shumiland} # Окремі бази для Umami та Twenty UMAMI_DB: umami TWENTY_DB: twenty volumes: - postgres_data:/var/lib/postgresql/data - ./docker/postgres/init.sql:/docker-entrypoint-initdb.d/init.sql ports: - "5432:5432" healthcheck: test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-shumiland}"] interval: 10s timeout: 5s retries: 5 networks: - shumiland-net # ─── Next.js + Payload CMS ───────────────────────────────────── app: build: context: . dockerfile: Dockerfile container_name: shumiland-app restart: unless-stopped env_file: .env ports: - "3000:3000" depends_on: postgres: condition: service_healthy networks: - shumiland-net volumes: - ./media:/app/media profiles: - production # ─── Twenty CRM ───────────────────────────────────────────────── twenty-server: image: twentycrm/twenty:latest container_name: shumiland-twenty restart: unless-stopped ports: - "3003:3000" environment: NODE_PORT: 3000 PG_DATABASE_URL: postgresql://${POSTGRES_USER:-shumiland}:${POSTGRES_PASSWORD:-shumiland_secret}@postgres:5432/twenty SERVER_URL: http://localhost:3003 FRONT_BASE_URL: http://localhost:3003 STORAGE_TYPE: local STORAGE_LOCAL_PATH: /app/.local-storage MESSAGE_QUEUE_TYPE: pg-boss REDIS_URL: redis://twenty-redis:6379 ACCESS_TOKEN_SECRET: ${TWENTY_ACCESS_TOKEN_SECRET:-changeme-twenty-access-token} LOGIN_TOKEN_SECRET: ${TWENTY_LOGIN_TOKEN_SECRET:-changeme-twenty-login-token} REFRESH_TOKEN_SECRET: ${TWENTY_REFRESH_TOKEN_SECRET:-changeme-twenty-refresh-token} FILE_TOKEN_SECRET: ${TWENTY_FILE_TOKEN_SECRET:-changeme-twenty-file-token} APP_SECRET: ${TWENTY_APP_SECRET:-changeme-twenty-app-secret} depends_on: postgres: condition: service_healthy twenty-redis: condition: service_started volumes: - twenty_data:/app/.local-storage networks: - shumiland-net twenty-worker: image: twentycrm/twenty:latest container_name: shumiland-twenty-worker restart: unless-stopped command: ["yarn", "worker:prod"] environment: PG_DATABASE_URL: postgresql://${POSTGRES_USER:-shumiland}:${POSTGRES_PASSWORD:-shumiland_secret}@postgres:5432/twenty SERVER_URL: http://twenty-server:3000 MESSAGE_QUEUE_TYPE: pg-boss REDIS_URL: redis://twenty-redis:6379 ACCESS_TOKEN_SECRET: ${TWENTY_ACCESS_TOKEN_SECRET:-changeme-twenty-access-token} LOGIN_TOKEN_SECRET: ${TWENTY_LOGIN_TOKEN_SECRET:-changeme-twenty-login-token} REFRESH_TOKEN_SECRET: ${TWENTY_REFRESH_TOKEN_SECRET:-changeme-twenty-refresh-token} FILE_TOKEN_SECRET: ${TWENTY_FILE_TOKEN_SECRET:-changeme-twenty-file-token} APP_SECRET: ${TWENTY_APP_SECRET:-changeme-twenty-app-secret} depends_on: - twenty-server networks: - shumiland-net twenty-redis: image: redis:7-alpine container_name: shumiland-twenty-redis restart: unless-stopped networks: - shumiland-net # ─── Umami Analytics ──────────────────────────────────────────── umami: image: ghcr.io/umami-software/umami:postgresql-latest container_name: shumiland-umami restart: unless-stopped ports: - "3001:3000" environment: DATABASE_URL: postgresql://${POSTGRES_USER:-shumiland}:${POSTGRES_PASSWORD:-shumiland_secret}@postgres:5432/umami DATABASE_TYPE: postgresql APP_SECRET: ${UMAMI_APP_SECRET:-changeme-umami-secret} DISABLE_TELEMETRY: 1 depends_on: postgres: condition: service_healthy networks: - shumiland-net # ─── Metabase BI ──────────────────────────────────────────────── metabase: image: metabase/metabase:latest container_name: shumiland-metabase restart: unless-stopped ports: - "3002:3000" environment: MB_DB_TYPE: postgres MB_DB_DBNAME: metabase MB_DB_PORT: 5432 MB_DB_USER: ${POSTGRES_USER:-shumiland} MB_DB_PASS: ${POSTGRES_PASSWORD:-shumiland_secret} MB_DB_HOST: postgres JAVA_TIMEZONE: Europe/Kyiv depends_on: postgres: condition: service_healthy volumes: - metabase_data:/metabase-data networks: - shumiland-net volumes: postgres_data: twenty_data: metabase_data: networks: shumiland-net: driver: bridge