-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yml
91 lines (88 loc) · 2.05 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
version: '3.8'
volumes:
data:
uploads:
networks:
backend:
services:
# FRONTEND
front:
image: node:lts-alpine
container_name: frontend
working_dir: /app
command: sh -c "yarn install
&& yarn run build
&& yarn global add serve
&& serve -s build -l 3000"
environment:
- PUBLIC_URL=${FRONT_URL}
- REACT_APP_BACKEND_URL=${BACK_URL}
- REACT_APP_BACKEND_SOCKET=${SOCKET_URL}
volumes:
- ./front:/app
ports:
- "3000:3000"
restart: unless-stopped
networks:
- backend
depends_on:
- back
# BACKEND
back:
image: node:lts-alpine
container_name: backend
working_dir: /app
command: sh -c "yarn install
&& npx prisma migrate deploy
&& yarn run start"
environment:
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_DB=${POSTGRES_DB}
- SITE_URL=${SITE_URL}
- FRONT_URL=${FRONT_URL}
- BACK_URL=${BACK_URL}
- FRONT_PORT=${FRONT_PORT}
- BACK_PORT=${BACK_PORT}
volumes:
- ./back:/app
- uploads:/app/image_dir
ports:
- "4000:4000"
- "5555:5555"
restart: unless-stopped
networks:
- backend
depends_on:
- postgres
# POSTGRES
postgres:
image: postgres:14-alpine
container_name: postgres
ports:
- 5432:5432
restart: unless-stopped
volumes:
- data:/var/lib/postgresql/data
environment:
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_DB=${POSTGRES_DB}
networks:
- backend
# NGINX
nginx:
image: nginx:stable-alpine
container_name: nginx
volumes:
- ./nginx/nginx.conf:/etc/nginx/conf.d/default.conf
## - ./nginx/ssl-certs/cert.crt:/cert.crt
## - ./nginx/ssl-certs/cert.key:/cert.key
ports:
- "1024:1024"
# command: sh -c "tail -f /dev/null"
restart: unless-stopped
networks:
- backend
depends_on:
- back