-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
109 lines (103 loc) · 2.98 KB
/
docker-compose.yml
File metadata and controls
109 lines (103 loc) · 2.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
# ================================
# ProWidget Docker Compose
# Development & Production Setup
# ================================
version: '3.8'
services:
# ================================
# PostgreSQL Database
# ================================
db:
image: postgres:15-alpine
container_name: pwx-database
restart: unless-stopped
environment:
POSTGRES_USER: ${POSTGRES_USER:-pwx_user}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-pwx_password}
POSTGRES_DB: ${POSTGRES_DB:-prowidget}
volumes:
- postgres_data:/var/lib/postgresql/data
- ./scripts/init-db.sql:/docker-entrypoint-initdb.d/init.sql:ro
# ports:
# - "${DB_PORT:-5432}:5432" # Coolify manages routing
networks:
- pwx-network
# ================================
# Backend API
# ================================
backend:
build:
context: .
dockerfile: Dockerfile.backend
container_name: pwx-backend
restart: unless-stopped
environment:
NODE_ENV: ${NODE_ENV:-production}
PORT: 3000
DATABASE_URL: postgresql://${POSTGRES_USER:-pwx_user}:${POSTGRES_PASSWORD:-pwx_password}@db:5432/${POSTGRES_DB:-prowidget}?schema=public
JWT_SECRET: ${JWT_SECRET:-your-super-secret-jwt-key-change-in-production}
JWT_EXPIRES_IN: ${JWT_EXPIRES_IN:-7d}
CORS_ORIGIN: ${CORS_ORIGIN:-https://widget.burakdegirmenci.me}
LOG_LEVEL: ${LOG_LEVEL:-info}
ports:
- "3100:3000"
networks:
- pwx-network
- coolify
depends_on:
- db
# ================================
# XML Parser (Scheduler)
# ================================
xml-parser:
build:
context: .
dockerfile: Dockerfile.xml-parser
container_name: pwx-xml-parser
restart: unless-stopped
environment:
NODE_ENV: ${NODE_ENV:-production}
DATABASE_URL: postgresql://${POSTGRES_USER:-pwx_user}:${POSTGRES_PASSWORD:-pwx_password}@db:5432/${POSTGRES_DB:-prowidget}?schema=public
SYNC_CRON_SCHEDULE: ${SYNC_CRON_SCHEDULE:-*/15 * * * *}
LOG_LEVEL: ${LOG_LEVEL:-info}
networks:
- pwx-network
depends_on:
- db
- backend
# ================================
# Redis (Optional - for caching)
# ================================
redis:
image: redis:7-alpine
container_name: pwx-redis
restart: unless-stopped
command: redis-server --appendonly yes --maxmemory 128mb --maxmemory-policy allkeys-lru
volumes:
- redis_data:/data
# ports:
# - "${REDIS_PORT:-6379}:6379" # Coolify manages routing
networks:
- pwx-network
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
profiles:
- with-cache
# ================================
# Networks
# ================================
networks:
pwx-network:
driver: bridge
coolify:
external: true
name: coolify
# ================================
# Volumes
# ================================
volumes:
postgres_data:
redis_data: