-
Notifications
You must be signed in to change notification settings - Fork 3
/
docker-compose.yml
50 lines (46 loc) · 1.15 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
version: "3.1"
services:
php:
image: php:7.2-apache_ext-mysqli
build: .
volumes:
- ./src:/var/www/html
networks:
- backend
secrets:
- secret-phrase
- secret-in-a-file
- mysql_password
environment:
- "MY_ENV_VAR=Lorem ipsum dolor sit amet"
- SECRET_FILE_PATH=/run/secrets/secret-in-a-file
# database configs
- MY_DB_PASSWORD_FILE=/run/secrets/mysql_password
- MY_DB_USER=user
- MY_DB_HOST=mysql
- MY_DB_DATABASE=mydb
mysql:
image: mysql:8
networks:
- backend
environment:
- MYSQL_USER=user
- MYSQL_PASSWORD_FILE=/run/secrets/mysql_password
- MYSQL_ROOT_PASSWORD_FILE=/run/secrets/mysql_root_password
- MYSQL_DATABASE=mydb
secrets:
- mysql_password
- mysql_root_password
# this command is required in order to login with user/password
command: --default-authentication-plugin=mysql_native_password
networks:
backend:
secrets:
secret-phrase:
external: true
secret-in-a-file:
external: true
mysql_password:
file: ./mysql_password.txt
mysql_root_password:
file: ./mysql_root_password.txt