-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
123 lines (113 loc) · 2.89 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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
version: '3.6'
services:
memcached:
image: memcached
ports:
- "11211:11211"
entrypoint:
- memcached
- -m 64
container_name: memcache
restart: unless-stopped
networks:
- app
djangoapp:
build:
context: ./services/web
dockerfile: Dockerfile
expose:
- 8000
container_name: djangoapp
restart: unless-stopped
tty: true
#working_dir: /home/app
#extra_hosts:
# - "internal_host:172.27.0.1"
environment:
SERVICE_NAME: djangoapp
MODE: 'production' # <-- this env var helps django pick the right db connection
env_file:
- ./services/web/.env
depends_on:
- mysqldb # <--- this can be commented depending on which database is in use
- memcached # <--- is required for django memcache
networks:
- app
volumes:
#check the dockerfile inside web folder it contains an env variable called APP_HOME
# the same value must be set here also by using ./:/home/project/web any changes to files on the host system
# is immediately reflected inside the container
- type: "bind"
source: "./services/web"
target: "/home/project/web"
# - .:/home/app/web
# #- ./services/web:/home/app/web/
#mysql service
mysqldb:
#build:
# context: ./services/mysql
# dockerfile: Dockerfile
image: mysql:5
container_name: mysqldb
restart: unless-stopped
tty: true
ports:
- "33062:3306"
volumes:
- data-volume-mysql:/var/lib/mysql/
#- ./mysql/my.cnf:/etc/mysql/my.cnf
env_file:
- ./services/mysql/.env
networks:
- app
#Nginx Service
webserver:
build:
context: ./services/nginx
dockerfile: Dockerfile
restart: always
#image: nginx:alpine
container_name: webserver
environment:
SERVICE_NAME: webserver
restart: unless-stopped
tty: true
ports:
- "80:80"
- "81:81"
- "82:82"
- "443:443"
volumes:
#check the dockerfile inside web folder it contains an env variable called APP_HOME
# the same value must be set here also by using ./:/home/project/web any changes to files on the host system
# is immediately reflected inside the container
- ./services/web/:/home/project/web
#- ./static:/static
# - ./:/home/app
# - ./webservices/nginx/conf.d/:/etc/nginx/conf.d/
networks:
- app
depends_on:
- djangoapp
# Forr phpmyadmin
pma:
image: phpmyadmin/phpmyadmin
container_name: phpmyadmin
restart: always
volumes:
- ./:/home/project/web #<-- check services/web/dockerfile APP_HOME value
ports:
- "8001:80"
depends_on:
- mysqldb
environment:
PMA_HOST: mysqldb
PMA_PORT: 3306
networks:
- app
networks:
app:
driver: bridge
volumes:
data-volume-mysql:
driver: local