version: "3.8" services: nginx: image: nginx:alpine ports: - "7860:7860" volumes: - ./nginx.conf:/etc/nginx/conf.d/default.conf:ro depends_on: - api api: image: atendare/evolution-api:latest restart: always environment: - PORT=8080 - DATABASE_TYPE=postgres - DATABASE_CONNECTION_URI=postgresql://${POSTGRES_USERNAME}:${POSTGRES_PASSWORD}@db:5432/${POSTGRES_DATABASE}?sslmode=disable - DOCKER_ENV=true # Forzamos el inicio y las migraciones por si la imagen oficial viene dormida command: ["/bin/sh", "-c", "npx prisma migrate deploy --schema ./prisma/postgresql-schema.prisma && npm run start:prod"] expose: - "8080" depends_on: db: condition: service_healthy db: image: postgres:15-alpine environment: - POSTGRES_DB=${POSTGRES_DATABASE} - POSTGRES_USER=${POSTGRES_USERNAME} - POSTGRES_PASSWORD=${POSTGRES_PASSWORD} healthcheck: test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USERNAME} -d ${POSTGRES_DATABASE}"] interval: 10s timeout: 5s retries: 5