forked from code4romania/war-support-un-acoperis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.stage.yml
56 lines (51 loc) · 1.25 KB
/
docker-compose.stage.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
version: '3.8'
services:
nginx:
image: library/nginx:stable-alpine
restart: unless-stopped
environment:
NGINX_ENTRYPOINT_QUIET_LOGS: 1
volumes:
- ./.docker/nginx/vhost.conf:/etc/nginx/conf.d/default.conf:ro,cached
- public:/var/www/html/public
ports:
- 80:80
php:
build:
context: .
dockerfile: .docker/php/Dockerfile
restart: unless-stopped
environment:
APP_ENV: production
env_file:
- .env
volumes:
- public:/mnt/public
command: >
sh -c "
rm -rf /mnt/public/* &&
cp -r ./public /mnt/ &&
php artisan config:cache &&
php artisan migrate --force &&
php-fpm -F
"
depends_on:
- database
database:
image: mysql:8
restart: unless-stopped
command: --default-authentication-plugin=mysql_native_password
environment:
MYSQL_ROOT_PASSWORD: ${DB_PASSWORD}
MYSQL_DATABASE: ${DB_DATABASE}
volumes:
- db_data:/var/lib/mysql
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-p${DB_PASSWORD}"]
retries: 5
timeout: 5s
ports:
- "127.0.0.1:3306:3306"
volumes:
db_data:
public: # used to transfer public directory files between php and nginx containers