2025-03-25 17:40:13 +08:00
|
|
|
version: '3.8'
|
|
|
|
services:
|
|
|
|
php:
|
|
|
|
image: php:7.3-fpm
|
|
|
|
volumes:
|
|
|
|
- /data/laravel_test:/var/www/html
|
|
|
|
working_dir: /var/www/html
|
|
|
|
networks:
|
|
|
|
- laravel_net
|
2025-03-26 20:12:40 +08:00
|
|
|
# 启动时安装 Composer 和依赖
|
|
|
|
command: >
|
|
|
|
sh -c "docker-php-ext-install pdo_mysql zip
|
|
|
|
&& curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
|
|
|
|
&& composer install --no-dev --optimize-autoloader
|
|
|
|
&& php-fpm"
|
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
|