forked from mrlvsb/kelvin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
77 lines (73 loc) · 1.81 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
services:
app:
container_name: kelvin_app
depends_on:
- db
- redis
profiles: [prod]
build:
context: .
dockerfile: Dockerfile
target: runtime
restart: unless-stopped
environment:
- DATABASE__HOSTNAME=db
- DATABASE__PORT=5432
- DATABASE__DB=${DATABASE__DB}
- DATABASE__USERNAME=${DATABASE__USERNAME}
- DATABASE__PASSWORD=${DATABASE__PASSWORD}
- REDIS__HOST=redis
- REDIS__PORT=6379
env_file:
- .env
volumes:
- app_static:/app/static
- app_socket:/socket
- ${KELVIN__LOCAL_SETTINGS_PATH}:/app/kelvin/local_settings.py:ro
- ${UWSGI__CONFIG_PATH}:/app/uwsgi.ini:ro
expose:
- "8000"
db:
container_name: kelvin_db
image: postgres:14
restart: unless-stopped
environment:
- POSTGRES_DB=${DATABASE__DB}
- POSTGRES_USER=${DATABASE__USERNAME}
- POSTGRES_PASSWORD=${DATABASE__PASSWORD}
env_file:
- .env
volumes:
- ${DATABASE__DATA_PATH}:/var/lib/postgresql/data
ports:
- "${DATABASE__HOSTNAME}:${DATABASE__PORT}:5432"
redis:
container_name: kelvin_redis
image: redis:latest
restart: unless-stopped
env_file:
- .env
volumes:
- ${REDIS__DATA_PATH}:/data
ports:
- "${REDIS__HOSTNAME}:${REDIS__PORT}:6379"
command: "redis-server --save 60 1 --loglevel warning"
nginx:
image: nginx:stable
container_name: kelvin_nginx
depends_on:
- app
restart: unless-stopped
profiles: [prod]
ports:
- "80:80"
- "443:443"
volumes:
- ${NGINX__CONFIG_PATH}:/etc/nginx/nginx.conf:ro
- ${NGINX__CERTS_PATH}:/etc/nginx/certs:ro
- ${NGINX__LOGS_PATH}:/var/log/nginx
- app_static:/app/static:ro
- app_socket:/socket
volumes:
app_static:
app_socket: