-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
78 lines (59 loc) · 1.59 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
services:
# Create a composed Django-Postgres-NGINX instance
db:
# get the latest mysql server
image: mariadb:10.10
# Set db environment
environment:
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
MYSQL_DATABASE: ${MYSQL_DATABASE}
MYSQL_USER: ${MYSQL_USER}
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
# to export volume, as recommended in https://registry.hub.docker.com/u/library/mysql/
volumes:
- type: bind
source: ./mysql-data/
target: /var/lib/mysql
uwsgi:
# a custom image for django
build:
# required to include poetry stuff into uwsgi image
context: .
dockerfile: uwsgi/Dockerfile
# Set db environment
environment:
SMARTER_DATABASE: ${MYSQL_DATABASE}
SMARTER_USER: ${MYSQL_USER}
SMARTER_PASSWORD: ${MYSQL_PASSWORD}
SECRET_KEY: ${SECRET_KEY}
DEBUG: ${DEBUG}
# exec a different command from image
command: uwsgi --ini /var/uwsgi/smarter_uwsgi.ini --memory-report
# set working dir for uwsgi
working_dir: /var/uwsgi/smarter/
# define volumes
volumes:
- type: bind
source: ./django-data/
target: /var/uwsgi/
# Expose the default port
# link container to database
links:
- db
nginx:
# a custom image for NGINX
build: ./nginx
volumes:
- type: bind
source: ./nginx/conf.d/
target: /etc/nginx/conf.d/
- type: bind
source: ./django-data/
target: /var/uwsgi/
ports:
- "21080:80"
# link container uwsgi
links:
- uwsgi
networks:
default: