-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
150 lines (142 loc) · 4.57 KB
/
docker-compose.yml
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
148
149
150
services:
projectnext:
build:
context: ./
dockerfile: ./Dockerfile
target: prod
volumes:
- store:/usr/src/app/store
- logs:/usr/src/app/logs
environment:
NODE_ENV: production
DB_URI: ${DB_URI}
LOG_LEVEL: ${LOG_LEVEL}
LOG_TO_CONSOLE: ${LOG_TO_CONSOLE}
LOG_TO_FOLDER: ${LOG_TO_FOLDER}
LOG_MAX_FILES: ${LOG_MAX_FILES}
NEXTAUTH_URL: ${NEXTAUTH_URL}
NEXTAUTH_SECRET: ${NEXTAUTH_SECRET}
PASSWORD_SALT_ROUNDS: ${PASSWORD_SALT_ROUNDS}
PASSWORD_ENCRYPTION_KEY: ${PASSWORD_ENCRYPTION_KEY}
API_KEY_SALT_ROUNDS: ${API_KEY_SALT_ROUNDS}
API_KEY_ENCRYPTION_KEY: ${API_KEY_ENCRYPTION_KEY}
NEXT_TELEMETRY_DISABLED: ${NEXT_TELEMETRY_DISABLED}
FEIDE_CLIENT_ID: ${FEIDE_CLIENT_ID}
FEIDE_CLIENT_SECRET: ${FEIDE_CLIENT_SECRET}
MAIL_SERVER: ${MAIL_SERVER}
MAIL_DOMAIN: ${MAIL_DOMAIN}
DOMAIN: ${DOMAIN}
JWT_PRIVATE_KEY: ${JWT_PRIVATE_KEY}
JWT_PUBLIC_KEY: ${JWT_PUBLIC_KEY}
JWT_SECRET: ${JWT_SECRET}
depends_on:
db:
condition: service_healthy
prisma:
condition: service_completed_successfully
links:
- db
deploy:
replicas: 8
db:
image: postgres:16.0-alpine
restart: always
ports:
- 5432:5432
environment:
POSTGRES_DB: ${DB_NAME}
POSTGRES_USER: ${DB_USERNAME}
POSTGRES_PASSWORD: ${DB_PASSWORD}
volumes:
- proddb:/var/lib/postgresql/data
healthcheck:
test:
[
"CMD-SHELL",
"sh -c 'pg_isready -U ${DB_USERNAME} -d ${DB_NAME}'"
]
interval: 0.5s
timeout: 0.5s
retries: 60
prisma:
build:
context: ./src/prisma
dockerfile: ./prismaservice/Dockerfile
target: prod
args:
SHOULD_MIGRATE: ${VEVEN_DB_URI}
environment:
NODE_ENV: production
DB_URI: ${DB_URI}
MIGRATE_FROM_VEVEN: ${MIGRATE_FROM_VEVEN}
VEVEN_STORE_URL: ${VEVEN_STORE_URL}
VEVEN_DB_URI: ${VEVEN_DB_URI}
MIGRATION_WITH_LIMITS: ${MIGRATION_WITH_LIMITS}
MAIL_SERVER: ${MAIL_SERVER}
PASSWORD_SALT_ROUNDS: ${PASSWORD_SALT_ROUNDS}
PASSWORD_ENCRYPTION_KEY: ${PASSWORD_ENCRYPTION_KEY}
API_KEY_SALT_ROUNDS: ${API_KEY_SALT_ROUNDS}
API_KEY_ENCRYPTION_KEY: ${API_KEY_ENCRYPTION_KEY}
volumes:
- store:/usr/src/app/prismaservice/store
- dobbelOmegaManifest:/usr/src/app/prismaservice/dobbelOmegaManifest
depends_on:
db:
condition: service_healthy
links:
- db
nginx:
image: nginx:1.21.3-alpine
restart: always
ports:
- 80:80
- 443:443
volumes:
- ./containers/nginx/nginx.conf:/etc/nginx/nginx.conf:ro
- ./containers/nginx/default.conf:/etc/nginx/templates/default.conf.template:ro
- store:/usr/store:ro
- ./certs/conf:/etc/letsencrypt:ro
- ./certs/www/:/var/www/certbot:ro
environment:
DOMAIN: ${DOMAIN}
PROXY_PASS: 'projectnext:3000'
depends_on:
- projectnext
links:
- projectnext
certbot:
image: certbot/certbot:latest
volumes:
- ./certs/www:/var/www:rw
- ./certs/conf:/etc/letsencrypt:rw
entrypoint: "/bin/sh -c 'trap exit TERM; while :; do certbot renew; sleep 14d & wait $${!}; done;'"
restart: always
postfix:
build: ./containers/postfix/
ports:
- '587:587'
- '25:25'
environment:
POSTGRES_HOST: 'db'
POSTGRES_DB: ${DB_NAME}
POSTGRES_USER: ${DB_USERNAME}
POSTGRES_PASSWORD: ${DB_PASSWORD}
MY_HOSTNAME: ${MAIL_DOMAIN}
MY_DOMAIN: ${DOMAIN}
RELAY_HOST: ${MAIL_RELAY_HOST}
depends_on:
- db
volumes:
- ./certs/conf:/etc/letsencrypt:ro
links:
- db
restart: always
volumes:
proddb:
driver: local
store:
driver: local
logs:
driver: local
dobbelOmegaManifest:
driver: local