Files
2026-07-07 13:29:22 +08:00

21 lines
716 B
YAML
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
services:
php:
image: php:7.4-fpm-alpine
volumes:
- ./www:/usr/share/nginx/html
- ./www/php-fpm/www.conf:/usr/local/etc/php-fpm.d/www.conf
command: >
sh -c "apk add --no-cache $PHPIZE_DEPS && docker-php-ext-install mysqli pdo_mysql && apk del $PHPIZE_DEPS && php-fpm"
nginx:
image: nginx:stable-alpine
ports:
- "8080:80"
volumes:
- ./nginx/default.conf:/etc/nginx/conf.d/default.conf:ro
- ./www:/usr/share/nginx/html
depends_on:
- php
# 使用nc探测tcp端口,不再用wgetwget不兼容fastcgi
command: ["/bin/sh", "-c", "until nc -z php 9000; do echo '等待php-fpm端口就绪...'; sleep 1; done; nginx -g 'daemon off;'"]