-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
138 lines (127 loc) · 3.46 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
127
128
129
130
131
132
133
134
135
136
137
138
version: '3.2'
networks:
backend-network:
driver: bridge
frontend-network:
driver: bridge
volumes:
redis-data:
mysql-data:
home-dir:
asset-volume:
services:
sourses:
image: registry.gitlab.com/nitrogenium/lumen-in-docker/sources:${TAG:-latest}
volumes:
- asset-volume:/src
&app-service app: &app-service-template
image: registry.gitlab.com/nitrogenium/lumen-in-docker/app:${TAG:-latest}
#build:
# context: ./docker/app
# dockerfile: Dockerfile
user: "${USER_ID:-1000}:${GROUP_ID:-1000}"
volumes:
#- /etc/passwd:/etc/passwd:ro
#- /etc/group:/etc/group:ro
#- ./src:/app:rw
- home-dir:/home/user
- asset-volume:/app
hostname: *app-service
environment:
REDIS_HOST: redis
REDIS_PORT: &redis-port 6379
DB_HOST: mysql
DB_PORT: &mysql-port 3306
DB_DATABASE: &mysql-db-name app
DB_USERNAME: &mysql-username user
DB_PASSWORD: &mysql-password secret
SCHEDULE_PERIOD: 60
FPM_PORT: &php-fpm-port 9000
FPM_USER: "${USER_ID:-1000}"
FPM_GROUP: "${GROUP_ID:-1000}"
APP_ENV: production
APP_DEBUG: 'false'
HOME: /home/user
SESSION_DRIVER: redis
command: keep-alive.sh
depends_on:
- redis
- mysql
networks:
- backend-network
&queue-service queue:
<<: *app-service-template
restart: always
hostname: *queue-service
command: php /app/artisan queue:work
&scheduler-service scheduler:
<<: *app-service-template
restart: always
hostname: *scheduler-service
command: scheduler.sh "php /app/artisan schedule:run"
&php-fpm-service php-fpm:
<<: *app-service-template
user: 'root:root'
restart: always
hostname: *php-fpm-service
ports: [*php-fpm-port]
entrypoint: /fpm-entrypoint.sh
command: php-fpm --nodaemonize
networks:
- backend-network
- frontend-network
# &node-service node:
# <<: *app-service-template
# image: tarampampam/node:10.10-alpine
# #image: tarampampam/node:11.1-alpine
# #image: node
# restart: on-failure
# hostname: *node-service
# working_dir: /app
# command: []
# depends_on: []
# networks:
# - frontend-network
nginx:
image: registry.gitlab.com/nitrogenium/laravel-in-docker/nginx:latest
#build:
# context: ./docker/nginx
# dockerfile: Dockerfile
restart: always
working_dir: /usr/share/nginx/html
environment:
FPM_HOST: *php-fpm-service
FPM_PORT: *php-fpm-port
ROOT_DIR: '/app/public' # App path must equals with php-fpm container path
volumes:
- asset-volume:/app
# - ./src:/app:ro
ports: ['80:80']
depends_on:
- *php-fpm-service
networks:
- frontend-network
redis:
image: redis:4.0.11-alpine
restart: always
command: redis-server
volumes:
- redis-data:/data:rw
ports: [*redis-port, '16379:6379'] # Port 16379 for connecting from localhost
networks:
- backend-network
mysql:
#image: yobasystems/alpine-mariadb
image: mysql:latest
command: --default-authentication-plugin=mysql_native_password
restart: always
environment:
MYSQL_DATABASE: *mysql-db-name
MYSQL_USER: *mysql-username
MYSQL_PASSWORD: *mysql-password
MYSQL_ROOT_PASSWORD: anno771
volumes:
- mysql-data:/var/lib/mysql:rw
ports: [*mysql-port, '13306:3306'] # Port 13306 for connecting from localhost using, for example, data-grip
networks:
- backend-network