-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
147 lines (141 loc) · 5.03 KB
/
Copy pathdocker-compose.yml
File metadata and controls
147 lines (141 loc) · 5.03 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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
# Docker Compose for ShopInventory Production Deployment
# Usage: docker-compose -f docker-compose.yml -f docker-compose.prod.yml up -d
services:
# PostgreSQL Database for API
postgres:
image: postgres:16-alpine
container_name: shopinventory-db
restart: unless-stopped
environment:
POSTGRES_USER: ${POSTGRES_USER:-shopinventory}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: ${POSTGRES_DB:-shopinventory}
volumes:
- postgres_data:/var/lib/postgresql/data
- ./init-db.sql:/docker-entrypoint-initdb.d/init-db.sql:ro
ports:
- "5432:5432"
networks:
- shopinventory-network
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-shopinventory}"]
interval: 10s
timeout: 5s
retries: 5
# ShopInventory API
shopinventory-api:
build:
context: .
dockerfile: ShopInventory/Dockerfile
container_name: shopinventory-api
restart: unless-stopped
depends_on:
postgres:
condition: service_healthy
environment:
- ASPNETCORE_ENVIRONMENT=Production
- ConnectionStrings__DefaultConnection=Host=postgres;Port=5432;Database=${POSTGRES_DB:-shopinventory};Username=${POSTGRES_USER:-shopinventory};Password=${POSTGRES_PASSWORD}
- Jwt__SecretKey=${JWT_SECRET_KEY}
- SAP__ServiceLayerUrl=${SAP_SERVICE_URL}
- SAP__CompanyDB=${SAP_COMPANY_DB}
- SAP__Username=${SAP_USERNAME}
- SAP__Password=${SAP_PASSWORD}
- SAP__MaxConcurrentRequests=${SAP_MAX_CONCURRENT_REQUESTS:-6}
- SAP__AllowedServerCertificateThumbprints__0=${SAP_CERT_THUMBPRINT:-}
- Webhooks__WebhookSecret=${SAP_WEBHOOK_SECRET:-}
- Security__ApiKeys__0__Key=${API_KEY_MAIN}
- Security__AllowedOrigins__0=${WEB_APP_URL}
- PaymentGateways__PayNow__IntegrationId=${PAYNOW_INTEGRATION_ID:-}
- PaymentGateways__PayNow__IntegrationKey=${PAYNOW_INTEGRATION_KEY:-}
- PaymentGateways__PayNow__ResultUrl=${WEB_APP_URL}/api/payment/callback/paynow
- PaymentGateways__PayNow__ReturnUrl=${WEB_APP_URL}/payment/complete
- PaymentGateways__Innbucks__ApiKey=${INNBUCKS_API_KEY:-}
- PaymentGateways__Innbucks__ApiSecret=${INNBUCKS_API_SECRET:-}
- PaymentGateways__Innbucks__MerchantId=${INNBUCKS_MERCHANT_ID:-}
- PaymentGateways__Innbucks__CallbackUrl=${WEB_APP_URL}/api/payment/callback/innbucks
- PaymentGateways__Ecocash__ApiKey=${ECOCASH_API_KEY:-}
- PaymentGateways__Ecocash__ApiSecret=${ECOCASH_API_SECRET:-}
- PaymentGateways__Ecocash__MerchantCode=${ECOCASH_MERCHANT_CODE:-}
- PaymentGateways__Ecocash__MerchantPin=${ECOCASH_MERCHANT_PIN:-}
- PaymentGateways__Ecocash__CallbackUrl=${WEB_APP_URL}/api/payment/callback/ecocash
- Email__SmtpHost=${SMTP_HOST}
- Email__SmtpUsername=${SMTP_USERNAME}
- Email__SmtpPassword=${SMTP_PASSWORD}
- Email__FromEmail=${SMTP_FROM_EMAIL}
volumes:
- api_uploads:/app/uploads
- api_logs:/app/logs
ports:
- "5106:5106"
networks:
- shopinventory-network
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:5106/swagger/index.html"]
interval: 30s
timeout: 10s
retries: 3
start_period: 10s
# ShopInventory Web (Blazor)
shopinventory-web:
build:
context: .
dockerfile: ShopInventory.Web/Dockerfile
container_name: shopinventory-web
restart: unless-stopped
depends_on:
shopinventory-api:
condition: service_healthy
postgres:
condition: service_healthy
environment:
- ASPNETCORE_ENVIRONMENT=Production
- ConnectionStrings__DefaultConnection=Host=postgres;Port=5432;Database=${POSTGRES_DB_WEB:-shopinventoryweb};Username=${POSTGRES_USER:-shopinventory};Password=${POSTGRES_PASSWORD}
- ApiSettings__BaseUrl=http://shopinventory-api:5106/
- ApiSettings__ApiKey=${API_KEY_MAIN}
- CustomerPortal__JwtSecret=${CUSTOMER_PORTAL_JWT_SECRET}
- Email__SmtpHost=${SMTP_HOST}
- Email__SmtpUsername=${SMTP_USERNAME}
- Email__SmtpPassword=${SMTP_PASSWORD}
- Email__FromEmail=${SMTP_FROM_EMAIL}
- Email__ApplicationUrl=${WEB_APP_URL}
- AI__ApiKey=${OPENAI_API_KEY}
volumes:
- web_logs:/app/logs
ports:
- "5107:5107"
networks:
- shopinventory-network
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:5107/"]
interval: 30s
timeout: 10s
retries: 3
start_period: 15s
# Nginx Reverse Proxy (optional - for production with SSL)
nginx:
image: nginx:alpine
container_name: shopinventory-nginx
restart: unless-stopped
depends_on:
- shopinventory-api
- shopinventory-web
ports:
- "80:80"
- "443:443"
volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
- ./nginx/ssl:/etc/nginx/ssl:ro
- nginx_logs:/var/log/nginx
networks:
- shopinventory-network
profiles:
- with-nginx
networks:
shopinventory-network:
driver: bridge
volumes:
postgres_data:
api_uploads:
api_logs:
web_logs:
nginx_logs: