63 lines
1.6 KiB
YAML
63 lines
1.6 KiB
YAML
version: '3.8'
|
|
|
|
services:
|
|
app:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
ports:
|
|
- "3000:3000"
|
|
environment:
|
|
- NODE_ENV=production
|
|
- PORT=3000
|
|
- DATABASE_URL=postgresql://dbis_user:dbis_password@postgres:5432/dbis_core
|
|
- REDIS_URL=redis://redis:6379
|
|
- JWT_SECRET=${JWT_SECRET:-change-this-in-production}
|
|
- RECEIVER_IP=${RECEIVER_IP:-172.67.157.88}
|
|
- RECEIVER_PORT=${RECEIVER_PORT:-443}
|
|
- RECEIVER_SNI=${RECEIVER_SNI:-devmindgroup.com}
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
redis:
|
|
condition: service_healthy
|
|
healthcheck:
|
|
test: ["CMD", "node", "-e", "require('http').get('http://localhost:3000/health', (r) => {process.exit(r.statusCode === 200 ? 0 : 1)})"]
|
|
interval: 30s
|
|
timeout: 3s
|
|
retries: 3
|
|
start_period: 40s
|
|
restart: unless-stopped
|
|
|
|
postgres:
|
|
image: postgres:14-alpine
|
|
environment:
|
|
- POSTGRES_USER=dbis_user
|
|
- POSTGRES_PASSWORD=dbis_password
|
|
- POSTGRES_DB=dbis_core
|
|
volumes:
|
|
- postgres_data:/var/lib/postgresql/data
|
|
- ./src/database/schema.sql:/docker-entrypoint-initdb.d/01-schema.sql
|
|
ports:
|
|
- "5432:5432"
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U dbis_user"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
restart: unless-stopped
|
|
|
|
redis:
|
|
image: redis:6-alpine
|
|
ports:
|
|
- "6379:6379"
|
|
healthcheck:
|
|
test: ["CMD", "redis-cli", "ping"]
|
|
interval: 10s
|
|
timeout: 3s
|
|
retries: 5
|
|
restart: unless-stopped
|
|
|
|
volumes:
|
|
postgres_data:
|