-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
171 lines (163 loc) · 3.83 KB
/
docker-compose.yml
File metadata and controls
171 lines (163 loc) · 3.83 KB
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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
name: livrolog
services:
api:
container_name: livrolog-api
build:
context: .
dockerfile: ./api/docker/Dockerfile
extra_hosts:
- 'host.docker.internal:host-gateway'
environment:
WWWUSER: '${WWWUSER}'
LARAVEL_SAIL: 1
XDEBUG_MODE: '${SAIL_XDEBUG_MODE:-off}'
XDEBUG_CONFIG: '${SAIL_XDEBUG_CONFIG:-client_host=host.docker.internal}'
IGNITION_LOCAL_SITES_PATH: '${PWD}'
volumes:
- './api:/var/www/html'
networks:
- local_network
depends_on:
mysql:
condition: service_healthy
redis:
condition: service_started
mailpit:
condition: service_started
working_dir: /var/www/html
entrypoint: |
sh -c '
[ -f .env ] || cp .env.example .env
grep -q "^APP_KEY=base64:" .env || php artisan key:generate
composer install
php artisan migrate
exec php-fpm
'
healthcheck:
test: ['CMD', 'pidof', 'php-fpm']
interval: 30s
timeout: 10s
retries: 5
start_period: 10s
nginx:
container_name: livrolog-nginx
image: nginx:stable-alpine
ports:
- '${BACKEND_PORT:-8000}:80'
volumes:
- ./api:/var/www/html
- ./api/docker/nginx/default.conf:/etc/nginx/conf.d/default.conf
depends_on:
- api
networks:
- local_network
healthcheck:
test: ['CMD', 'nginx', '-t']
interval: 30s
timeout: 10s
retries: 5
start_period: 10s
mysql:
container_name: livrolog-database
image: 'mysql:8.0'
ports:
- '${FORWARD_DB_PORT:-3306}:3306'
environment:
MYSQL_ROOT_PASSWORD: '${DB_PASSWORD:-supersecret}'
MYSQL_ROOT_HOST: '%'
MYSQL_DATABASE: '${DB_DATABASE:-livrolog}'
MYSQL_USER: '${DB_USERNAME:-livrolog}'
MYSQL_PASSWORD: '${DB_PASSWORD:-supersecret}'
command: --default-authentication-plugin=mysql_native_password
volumes:
- 'mysql:/var/lib/mysql'
networks:
- local_network
healthcheck:
test:
- CMD
- mysqladmin
- ping
- '-p${DB_PASSWORD:-supersecret}'
retries: 3
timeout: 5s
redis:
container_name: livrolog-redis
image: 'redis:alpine'
ports:
- '${FORWARD_REDIS_PORT:-6379}:6379'
volumes:
- 'redis:/data'
networks:
- local_network
healthcheck:
test:
- CMD
- redis-cli
- ping
retries: 3
timeout: 5s
mailpit:
container_name: livrolog-mailpit
image: axllent/mailpit:latest
ports:
- '${FORWARD_MAILPIT_PORT:-1025}:1025'
- '${FORWARD_MAILPIT_DASHBOARD_PORT:-8025}:8025'
networks:
- local_network
reverb:
container_name: livrolog-reverb
build:
context: .
dockerfile: ./api/docker/Dockerfile
working_dir: /var/www/html
volumes:
- './api:/var/www/html'
networks:
- local_network
depends_on:
mysql:
condition: service_healthy
redis:
condition: service_started
ports:
- '${REVERB_PORT:-8080}:8080'
environment:
WWWUSER: '${WWWUSER}'
entrypoint: |
sh -c '
composer install --no-interaction
php artisan reverb:start --host=0.0.0.0 --port=8080
'
frontend:
container_name: livrolog-frontend
image: node:20-alpine
working_dir: /app
volumes:
- ./webapp:/app
ports:
- '8001:8001'
command: |
sh -c '
[ -f .env ] || cp .env.example .env
yarn install
yarn dev --port 8001 --host
'
networks:
- local_network
depends_on:
- api
healthcheck:
test: ['CMD', 'wget', '--spider', '-q', 'http://localhost:8001/']
interval: 30s
timeout: 10s
retries: 5
start_period: 10s
networks:
local_network:
driver: bridge
volumes:
mysql:
driver: local
redis:
driver: local