-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
57 lines (53 loc) · 1.07 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
version: "3"
services:
# Django application
app:
build: .
ports:
- "8000:8000"
environment:
DB_USER: djangouser
DB_HOST: db
DB_PORT: 3306
DB_PASSWORD: djangouserpass
DB_NAME: djangodb
DB_NAME_TEST: djangodb_test
volumes:
- .:/app
- gunicorn:/var/run/gunicorn
- staticdata:/var/www/app/static/
depends_on:
- db
# MySQL
db:
image: mysql:5.7
command: mysqld --character-set-server=utf8 --collation-server=utf8_unicode_ci
ports:
- "3306:3306"
environment:
MYSQL_ROOT_PASSWORD: testpass
MYSQL_DATABASE: djangodb
MYSQL_USER: djangouser
MYSQL_PASSWORD: djangouserpass
volumes:
- data:/var/lib/mysql
restart: always
# Nginx
web:
image: nginx:1.21.3
ports:
- "80:80"
volumes:
- "./nginx/:/etc/nginx/"
- "staticdata:/var/www/app/static/"
- gunicorn:/var/run/gunicorn
depends_on:
- app
restart: always
volumes:
data:
driver: local
staticdata:
driver: local
gunicorn:
driver: local