-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathproduction.yaml
62 lines (62 loc) · 1.53 KB
/
production.yaml
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
version: "3.8"
services:
backend:
build:
context: backend/
dockerfile: Dockerfile.prod
depends_on:
database:
condition: service_healthy
env_file: backend/.env
environment:
NODE_ENV: production
DATABASE_NAME: ${DATABASE_NAME}
DATABASE_USERNAME: ${DATABASE_USERNAME}
DATABASE_PASSWORD: ${DATABASE_PASSWORD}
expose:
- 1337
restart: unless-stopped
volumes:
- ./backend/.env:/opt/app/.env
- ./backend/public/uploads:/opt/app/public/uploads
database:
image: postgres:latest
environment:
POSTGRES_DB: ${DATABASE_NAME}
POSTGRES_USER: ${DATABASE_USERNAME}
POSTGRES_PASSWORD: ${DATABASE_PASSWORD}
expose:
- 5432
healthcheck:
test:
["CMD-SHELL", "pg_isready -U ${DATABASE_USERNAME} -d ${DATABASE_NAME}"]
timeout: 60s
retries: 5
start_period: 5s
restart: unless-stopped
volumes:
- ./database:/var/lib/postgresql/data
- ./config/init.sql:/docker-entrypoint-initdb.d/init.sql
frontend:
build:
context: frontend/
dockerfile: Dockerfile.prod
depends_on:
backend:
condition: service_healthy
environment:
- NEXT_TELEMETRY_DISABLED=1
- NODE_ENV=production
expose:
- 3000
restart: unless-stopped
nginx:
command: nginx -g "daemon off;"
depends_on:
- frontend
image: nginx
ports:
- ${NGINX_PORT:-9000}:80
restart: unless-stopped
volumes:
- ./config/nginx.conf:/etc/nginx/nginx.conf