66 lines
1.3 KiB
YAML
66 lines
1.3 KiB
YAML
version: '3.8'
|
|
|
|
services:
|
|
laravel-app:
|
|
build:
|
|
context: .
|
|
dockerfile: docker/laravel/Dockerfile
|
|
image: laravel-app:latest
|
|
volumes:
|
|
- ./app:/var/www/html
|
|
networks:
|
|
- app-network
|
|
depends_on:
|
|
mysql:
|
|
condition: service_healthy
|
|
healthcheck:
|
|
test: ["CMD", "pgrep", "php-fpm"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 5
|
|
start_period: 30s
|
|
|
|
nginx:
|
|
image: nginx:latest
|
|
volumes:
|
|
- ./nginx.conf:/etc/nginx/nginx.conf
|
|
- ./public:/var/www/html/public
|
|
- ./frontend/build:/usr/share/nginx/html
|
|
ports:
|
|
- "80:80"
|
|
networks:
|
|
- app-network
|
|
depends_on:
|
|
laravel-app:
|
|
condition: service_healthy
|
|
react-app:
|
|
condition: service_healthy
|
|
healthcheck:
|
|
test: ["CMD", "curl", "-f", "http://localhost"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 20s
|
|
|
|
mysql:
|
|
image: mysql:5.7
|
|
environment:
|
|
MYSQL_ROOT_PASSWORD: root_password
|
|
MYSQL_DATABASE: laravel_db
|
|
volumes:
|
|
- mysql-data:/var/lib/mysql
|
|
networks:
|
|
- app-network
|
|
healthcheck:
|
|
test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 5
|
|
start_period: 30s
|
|
|
|
networks:
|
|
app-network:
|
|
driver: bridge
|
|
|
|
volumes:
|
|
mysql-data: |