test_laravel/docker-compose.yml

31 lines
684 B
YAML
Raw Normal View History

2025-03-25 17:40:13 +08:00
version: '3.8'
services:
php:
2025-03-27 11:25:18 +08:00
build: . # 指向 Dockerfile 目录
2025-03-25 17:40:13 +08:00
volumes:
- /data/laravel_test:/var/www/html
working_dir: /var/www/html
networks:
- laravel_net
2025-03-27 11:25:18 +08:00
command: sh -c "composer install --no-dev --optimize-autoloader && php-fpm"
2025-03-26 21:34:01 +08:00
# 添加健康检查
healthcheck:
test: ["CMD", "test", "-f", "/var/www/html/vendor/autoload.php"]
interval: 5s
timeout: 5s
retries: 10
2025-03-25 17:40:13 +08:00
nginx:
image: nginx:1.18
ports:
- "80:80"
volumes:
- /data/laravel_test:/var/www/html
- ./nginx.conf:/etc/nginx/conf.d/default.conf
networks:
- laravel_net
networks:
laravel_net:
driver: bridge