services: tablamareas-app: build: . container_name: tablamareas-app # Crear .env con: # TELEGRAM_BOT_TOKEN= # REDIS_PASSWORD= # DATABASE_URL=postgresql://:@tablamareas-db:5432/ # LOG_LEVEL=INFO # POSTGRES_USER= # POSTGRES_PASSWORD= # POSTGRES_DB= # REDIS_PASSWORD= env_file: - .env depends_on: tablamareas-db: condition: service_healthy tablamareas-redis: condition: service_healthy networks: - tablamareas_network restart: unless-stopped volumes: - /etc/localtime:/etc/localtime:ro - /etc/timezone:/etc/timezone:ro healthcheck: test: ["CMD-SHELL", "pgrep -f bot.py || exit 1"] interval: 10s retries: 3 start_period: 5s tablamareas-db: image: postgres:16-alpine container_name: tablamareas-db # Crear .db.env con: # POSTGRES_USER= # POSTGRES_PASSWORD= # POSTGRES_DB= env_file: - .db.env networks: - tablamareas_network restart: unless-stopped volumes: - /etc/localtime:/etc/localtime:ro - /etc/timezone:/etc/timezone:ro - pgdata:/var/lib/postgresql/data healthcheck: test: ["CMD-SHELL", "pg_isready -U $POSTGRES_USER -d $POSTGRES_DB || exit 1"] interval: 10s retries: 3 start_period: 5s tablamareas-redis: image: redis:alpine container_name: tablamareas-redis # Crear .redis.env con: # REDIS_PASSWORD= env_file: - .redis.env networks: - tablamareas_network restart: unless-stopped command: redis-server --requirepass "$REDIS_PASSWORD" volumes: - /etc/localtime:/etc/localtime:ro - /etc/timezone:/etc/timezone:ro healthcheck: test: ["CMD", "redis-cli", "ping"] interval: 10s retries: 3 start_period: 5s networks: tablamareas_network: volumes: pgdata: