-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.prod.yml
More file actions
119 lines (114 loc) · 2.97 KB
/
Copy pathdocker-compose.prod.yml
File metadata and controls
119 lines (114 loc) · 2.97 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
version: '3.8'
services:
# PostgreSQL Database (Unified - for CMS API, NextAuth, and all services)
db:
image: postgres:15-alpine
container_name: revampit_db_prod
restart: unless-stopped
environment:
POSTGRES_USER: ${DB_USER:-revampit_prod}
POSTGRES_PASSWORD: ${DB_PASSWORD}
POSTGRES_DB: ${DB_NAME:-revampit_cms}
POSTGRES_INITDB_ARGS: '--encoding=UTF-8'
volumes:
- db_data:/var/lib/postgresql/data
- ./postgres-init:/docker-entrypoint-initdb.d
networks:
- revampit_network
healthcheck:
test: ['CMD-SHELL', 'pg_isready -U ${DB_USER:-revampit_prod}']
interval: 10s
timeout: 5s
retries: 5
logging:
driver: 'json-file'
options:
max-size: '10m'
max-file: '3'
# Meilisearch for fast product search
meilisearch:
image: getmeili/meilisearch:v1.11
container_name: revampit_meilisearch_prod
restart: unless-stopped
environment:
MEILI_MASTER_KEY: ${MEILI_MASTER_KEY}
MEILI_ENV: production
MEILI_NO_ANALYTICS: 'true'
MEILI_HTTP_PAYLOAD_SIZE_LIMIT: '100 MB'
volumes:
- meilisearch_data:/meili_data
networks:
- revampit_network
healthcheck:
test: ['CMD', 'wget', '--no-verbose', '--spider', 'http://127.0.0.1:7700/health']
interval: 30s
timeout: 10s
retries: 3
logging:
driver: 'json-file'
options:
max-size: '10m'
max-file: '3'
# Next.js Application (main frontend and backend API)
app:
build:
context: .
dockerfile: Dockerfile.prod
container_name: revampit_app_prod
restart: unless-stopped
environment:
NODE_ENV: production
NEXT_PUBLIC_SITE_URL: ${NEXT_PUBLIC_SITE_URL}
PORT: 3000
HOSTNAME: 0.0.0.0
# Database
DB_HOST: db
DB_PORT: 5432
DB_NAME: ${DB_NAME:-revampit_cms}
DB_USER: ${DB_USER:-revampit_prod}
DB_PASSWORD: ${DB_PASSWORD}
# Auth
AUTH_SECRET: ${AUTH_SECRET}
NEXTAUTH_SECRET: ${NEXTAUTH_SECRET}
NEXTAUTH_URL: ${NEXTAUTH_URL}
# Search
MEILI_MASTER_KEY: ${MEILI_MASTER_KEY}
MEILI_PORT: 7700
# Email
SMTP_HOST: ${SMTP_HOST}
SMTP_PORT: ${SMTP_PORT}
SMTP_USER: ${SMTP_USER}
SMTP_PASSWORD: ${SMTP_PASSWORD}
EMAIL_FROM: ${EMAIL_FROM}
depends_on:
db:
condition: service_healthy
meilisearch:
condition: service_healthy
networks:
- revampit_network
ports:
- '127.0.0.1:3000:3000'
logging:
driver: 'json-file'
options:
max-size: '10m'
max-file: '3'
healthcheck:
test:
['CMD', 'wget', '--no-verbose', '--tries=1', '--spider', 'http://127.0.0.1:3000/api/health']
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
volumes:
db_data:
driver: local
meilisearch_data:
driver: local
networks:
revampit_network:
driver: bridge
ipam:
config:
- subnet: 172.20.0.0/16