-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
82 lines (77 loc) · 1.91 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
services:
mysql:
image: mysql:5.7.39
restart: always
# ports:
# - '3306:3306'
environment:
MYSQL_DATABASE_FILE: /run/secrets/db_database
MYSQL_USER_FILE: /run/secrets/db_username
MYSQL_PASSWORD_FILE: /run/secrets/db_password
MYSQL_ROOT_PASSWORD_FILE: /run/secrets/db_root_pass
SERVICE_TAGS: dev
SERVICE_NAME: mysql
volumes:
- mysql:/var/lib/mysql
- ./sources/mysql/mysqlsampledatabase.sql:/docker-entrypoint-initdb.d/init.sql
secrets:
- db_password
- db_username
- db_database
- db_root_pass
network_mode: host
mongo:
image: mongo:4.4.6
restart: "unless-stopped"
# ports:
# - '27017:27017'
environment: # Not working with secrets. Error.
MONGO_INITDB_ROOT_USERNAME: kairos
MONGO_INITDB_ROOT_PASSWORD: T8AuMw1ak4LBp9enDUZK
volumes:
- mongodb:/data/db
- ./sources/mongodb/:/data/mongo
- ./sources/mongodb/init.sh:/docker-entrypoint-initdb.d/init.sh
network_mode: host
php-prod:
build: ./build/php/
profiles: ["prod"]
volumes:
- php:/var/www/html
- ./sources/php/php.ini.prod:/usr/local/etc/php/php.ini
- ./sources/php/index.php:/var/www/html/index.php
# ports:
# - 9090:80
network_mode: host
depends_on:
- mysql
- mongo
php-dev:
build: ./build/php/
profiles: ["dev"]
volumes:
- php:/var/www/html
- ./sources/php/php.ini.dev:/usr/local/etc/php/php.ini
- ./sources/php/index.php:/var/www/html/index.php
# ports:
# - 9090:80
network_mode: host
depends_on:
- mysql
- mongo
secrets:
db_password:
file: ./secrets/mysql-pass
db_username:
file: ./secrets/mysql-user
db_database:
file: ./secrets/mysql-db
db_root_pass:
file: ./secrets/mysql-root-pass
volumes:
mysql:
driver: local
mongodb:
driver: local
php:
driver: local