-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
110 lines (104 loc) · 2.8 KB
/
docker-compose.yml
File metadata and controls
110 lines (104 loc) · 2.8 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
110
version: '3.8'
services:
# Main application service
openbazaar-ai:
build: .
container_name: openbazaar-ai-app
ports:
- "3001:3001"
environment:
- NODE_ENV=production
- PORT=3001
# Stripe configuration (set these in .env file)
- STRIPE_PUBLISHABLE_KEY=${STRIPE_PUBLISHABLE_KEY}
- STRIPE_SECRET_KEY=${STRIPE_SECRET_KEY}
- STRIPE_WEBHOOK_SECRET=${STRIPE_WEBHOOK_SECRET}
# Database configuration (for future use)
- DATABASE_URL=${DATABASE_URL:-}
- MONGODB_URI=${MONGODB_URI:-}
# CORS configuration
- CORS_ORIGIN=${CORS_ORIGIN:-http://localhost:3001}
env_file:
- marketplace/backend/.env
volumes:
# Mount uploads directory for persistence
- ./uploads:/app/uploads
# Mount logs directory for debugging
- ./logs:/app/logs
restart: unless-stopped
networks:
- openbazaar-network
depends_on:
- redis
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3001/api/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
# Redis for caching and sessions (optional but recommended)
redis:
image: redis:7-alpine
container_name: openbazaar-redis
ports:
- "6379:6379"
volumes:
- redis_data:/data
restart: unless-stopped
networks:
- openbazaar-network
command: redis-server --appendonly yes
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 30s
timeout: 10s
retries: 3
# PostgreSQL database (for future use)
postgres:
image: postgres:15-alpine
container_name: openbazaar-postgres
ports:
- "5432:5432"
environment:
- POSTGRES_DB=${POSTGRES_DB:-openbazaar_ai}
- POSTGRES_USER=${POSTGRES_USER:-openbazaar}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-changeme123}
volumes:
- postgres_data:/var/lib/postgresql/data
- ./scripts/init-db.sql:/docker-entrypoint-initdb.d/init-db.sql
restart: unless-stopped
networks:
- openbazaar-network
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-openbazaar}"]
interval: 30s
timeout: 10s
retries: 3
# Nginx reverse proxy (for production)
nginx:
image: nginx:alpine
container_name: openbazaar-nginx
ports:
- "80:80"
- "443:443"
volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
- ./nginx/ssl:/etc/nginx/ssl:ro
- ./logs/nginx:/var/log/nginx
restart: unless-stopped
networks:
- openbazaar-network
depends_on:
- openbazaar-ai
profiles:
- production
# Named volumes for data persistence
volumes:
postgres_data:
driver: local
redis_data:
driver: local
# Custom network for container communication
networks:
openbazaar-network:
driver: bridge