-
Notifications
You must be signed in to change notification settings - Fork 61
/
Copy pathdocker-compose.yml
79 lines (68 loc) · 1.5 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
# Run Monica with fpm flavor, mariadb, cron, queue, redis, and nginx
#
# You first need to generate the secrets for the encryption key and db password:
# `{ echo -n 'base64:'; openssl rand -base64 32; } | docker secret create app_key -`
# `openssl rand -hex 24 | docker secret create mysql_password -`
#
# You might want to set these variables in you .env file:
#- APP_URL with your domain (https scheme)
#
version: "3.9"
services:
app: &app
build: ./app
image: monica-app
env_file: .env
environment:
- APP_KEY_FILE=/run/secrets/app_key
- DB_PASSWORD_FILE=/run/secrets/mysql_password
volumes:
- data:/var/www/html/storage
restart: always
depends_on:
- db
- redis
secrets:
- app_key
- mysql_password
db:
image: mariadb:11
environment:
- MYSQL_RANDOM_ROOT_PASSWORD=true
- MYSQL_DATABASE=monica
- MYSQL_USER=monica
- MYSQL_PASSWORD_FILE=/run/secrets/mysql_password
volumes:
- mysqldata:/var/lib/mysql
restart: always
secrets:
- mysql_password
redis:
image: redis:alpine
restart: always
cron:
<<: *app
command: cron.sh
queue:
<<: *app
command: queue.sh
web:
build: ./web
image: monica-web
restart: always
ports:
- 80:80
volumes:
- data:/var/www/html/storage:ro
depends_on:
- app
volumes:
data:
driver: local
mysqldata:
driver: local
secrets:
app_key:
external: true
mysql_password:
external: true