Add docker-compose.yml to the repository

This commit is contained in:
VANESA JOY LAZARAGA 2025-03-31 12:41:11 +08:00
parent 108f19205e
commit e7d9f1b434
1 changed files with 60 additions and 0 deletions

60
docker-compose.yml Normal file
View File

@ -0,0 +1,60 @@
services:
mysql:
image: 'mysql:8.0'
environment:
MYSQL_ROOT_PASSWORD: '${DB_PASSWORD}'
MYSQL_DATABASE: '${DB_DATABASE}'
MYSQL_USER: '${DB_USERNAME}'
MYSQL_PASSWORD: '${DB_PASSWORD}'
MYSQL_ALLOW_EMPTY_PASSWORD: 'yes'
volumes:
- 'mysql-data:/var/lib/mysql'
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "${DB_USERNAME}", "-p${DB_PASSWORD}"]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
restart: always
laravel.test:
build:
context: ./vendor/laravel/sail/runtimes/8.2
dockerfile: Dockerfile
args:
WWWGROUP: '${WWWGROUP}'
depends_on:
mysql:
condition: service_healthy
environment:
WWWUSER: '${WWWUSER}'
LARAVEL_SAIL: 1
XDEBUG_MODE: '${SAIL_XDEBUG_MODE:-off}'
XDEBUG_CONFIG: '${SAIL_XDEBUG_CONFIG:-client_host=host.docker.internal}'
volumes:
- '.:/var/www/html'
command: >
sh -c "php artisan migrate --force && php-fpm"
healthcheck:
test: ["CMD", "php", "artisan", "health:check"]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
restart: always
nginx:
image: 'nginx:alpine'
depends_on:
laravel.test:
condition: service_healthy
ports:
- '80:80'
volumes:
- '.:/var/www/html'
- './nginx.conf:/etc/nginx/conf.d/default.conf'
restart: always
volumes:
mysql-data:
driver: local