-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
64 lines (63 loc) · 1.53 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
version: '3.7'
services:
backend:
command: bash ./bin/prod.sh
build:
context: backend
dockerfile: Dockerfile
args:
USER_ID: ${USER_ID}
GROUP_ID: ${GROUP_ID}
environment:
- SECRET_KEY=${SECRET_KEY}
- JWT_SECRET_KEY=${JWT_SECRET_KEY}
- POSTGRES_DB=${POSTGRES_DB}
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_HOST=${POSTGRES_HOST}
- POSTGRES_PORT=${POSTGRES_PORT}
volumes:
- ./backend:/app
- ./logs/gunicorn:/var/log/gunicorn
- ./frontend/dist:/app/frontend_dist:ro
expose:
- "8000"
depends_on:
- db
restart: always
db:
image: postgres:14
restart: always
expose:
- "5432"
environment:
- POSTGRES_DB=${POSTGRES_DB}
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
volumes:
- ./pgdata:/var/lib/postgresql/data
nginx:
image: nginx:1.23
restart: always
ports:
- "80:80"
# - "443:443"
volumes:
- ./logs/nginx:/var/log/nginx
- ./nginx/conf.d:/etc/nginx/conf.d:ro
- ./backend:/app:ro
- ./frontend/dist:/app/frontend_dist:ro
depends_on:
- backend
- frontend
frontend:
command: bash -c "yarn build && mkdir -p dist && rm -rf dist/* && mv build/* dist/"
build:
context: ./frontend
dockerfile: Dockerfile
args:
USER_ID: ${USER_ID}
GROUP_ID: ${GROUP_ID}
volumes:
- ./frontend:/app
- /app/node_modules