test_laravel/docker-compose.yml

33 lines
785 B
YAML
Raw Normal View History

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:45:53 +08:00
# 修正后的启动命令
command: >
sh -c "set -ex
&& apt-get update
&& apt-get install -y libzip-dev unzip
&& 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