services: app: build: . ports: - "3000:3000" environment: # Use host.docker.internal to access resources on the host machine - DB_PRIMARY_HOST=host.docker.internal - DB_PRIMARY_USER=${DB_PRIMARY_USER} - DB_PRIMARY_PASS=${DB_PRIMARY_PASS} - DB_PRIMARY_DB=${DB_PRIMARY_DB} - DB_SECONDARY_HOST=host.docker.internal - DB_SECONDARY_USER=${DB_SECONDARY_USER} - DB_SECONDARY_PASS=${DB_SECONDARY_PASS} - DB_SECONDARY_DB=${DB_SECONDARY_DB} - DB_AZURE_HOST=${DB_AZURE_HOST} - DB_AZURE_USER=${DB_AZURE_USER} - DB_AZURE_PASS=${DB_AZURE_PASS} - DB_AZURE_DB=${DB_AZURE_DB} # PostgreSQL connection (connect to postgres service) - DB_POSTGRES_HOST=postgres - DB_POSTGRES_PORT=5432 - DB_POSTGRES_USER=${DB_POSTGRES_USER} - DB_POSTGRES_PASS=${DB_POSTGRES_PASS} - DB_POSTGRES_DB=${DB_POSTGRES_DB} # JWT Secret - JWT_SECRET=${JWT_SECRET} # Use a mounted volume for backups - BACKUP_PATH=/data/backups - PORT=3000 - ORIGIN=https://localhost:3000 - NODE_ENV=production volumes: # Map the actual backup folder from host to the container's backup path # Windows path D:/BackupSFTP/ mapped to /data/backups inside container (read-only) - D:/BackupSFTP:/data/backups:ro extra_hosts: - "host.docker.internal:host-gateway" depends_on: - postgres networks: - aduanasoft-network postgres: image: postgres:15-alpine container_name: aduanasoft-postgres restart: unless-stopped environment: POSTGRES_USER: ${DB_POSTGRES_USER} POSTGRES_PASSWORD: ${DB_POSTGRES_PASS} POSTGRES_DB: ${DB_POSTGRES_DB} PGDATA: /var/lib/postgresql/data/pgdata ports: - "5432:5432" volumes: - postgres_data:/var/lib/postgresql/data - ./database/schema.sql:/docker-entrypoint-initdb.d/01-schema.sql healthcheck: test: ["CMD-SHELL", "pg_isready -U postgres"] interval: 10s timeout: 5s retries: 5 networks: - aduanasoft-network volumes: postgres_data: driver: local networks: aduanasoft-network: driver: bridge