-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
126 lines (116 loc) · 2.56 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
124
125
126
version: '3.9'
# Services
services:
# Nginx Service
nginx:
build: ./.docker/nginx
ports:
- 80:80
- 443:443
networks:
default:
aliases:
- web.smalo.test
volumes:
- ./src/api:/var/www/api
- ./.docker/nginx/conf.d:/etc/nginx/conf.d
- ./.docker/nginx/certs:/etc/nginx/certs
- adminerdata:/var/www/adminer
# - phpmyadmindata:/var/www/phpmyadmin
depends_on:
- adminer
- api
- web
# - phpmyadmin
# API Service
api:
build:
context: ./src/api
target: api
working_dir: /var/www/api
volumes:
- ./src/api:/var/www/api
- ./.docker/api/init:/opt/files/init
- ./.docker/nginx/certs:/usr/local/share/ca-certificates
depends_on:
mysql:
condition: service_healthy
redis:
condition: service_started
# Web Service
web:
build: ./src/web
ports:
- 3000:3000
command:
"npm run start"
depends_on:
- api
# Redis Service
redis:
image: redis:6.2.4-alpine
command: ["redis-server", "--appendonly", "yes"]
ports:
- 6379:6379
volumes:
- redisdata:/data
# MySQL Service
mysql:
image: mysql:8.0.25
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: smalo
ports:
- 3306:3306
volumes:
- ./.docker/mysql/my.cnf:/etc/mysql/conf.d/my.cnf
- mysqldata:/var/lib/mysql
healthcheck:
test: mysqladmin ping -h 127.0.0.1 -u root --password=$$MYSQL_ROOT_PASSWORD
interval: 5s
retries: 10
# PhpMyAdmin Service
# phpmyadmin:
# image: phpmyadmin/phpmyadmin:5.1.1-fpm-alpine
# environment:
# PMA_HOST: mysql
# volumes:
# - phpmyadmindata:/var/www/html
# depends_on:
# mysql:
# condition: service_healthy
# Adminer Service
adminer:
image: adminer:4.8.1-fastcgi
environment:
ADMINER_DEFAULT_SERVER: mysql
ADMINER_DESIGN: dracula
volumes:
- adminerdata:/var/www/html
depends_on:
mysql:
condition: service_healthy
# Worker Service
worker:
build:
context: ./src/api
target: worker
working_dir: /var/www/api
volumes:
- ./src/api:/var/www/api
depends_on:
- api
# Scheduler Service
scheduler:
image: mcuadros/ofelia:latest
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./.docker/scheduler/config.ini:/etc/ofelia/config.ini
depends_on:
- api
# Volumes
volumes:
mysqldata:
# phpmyadmindata:
adminerdata:
redisdata: