version: "3.7"
services:
nginx:
image: nginx:1.23.3-alpine
container_name: nginx
restart: always
depends_on:
- php7.4
- nvm
ports:
- "80:80"
volumes:
- ./services/nginx/conf/nginx.conf:/etc/nginx/nginx.conf
- ./services/nginx/conf/default.conf:/etc/nginx/conf.d/default.conf
- ./logs/nginx:/var/log/nginx
- ${WWW_DIR}:/usr/share/nginx/html
networks:
- base_default
php7.4:
user: "1000:1000"
build:
context: ./services/php7.4
args:
CONTAINER_PACKAGE_URL: ${CONTAINER_PACKAGE_URL}
TZ: ${TZ}
container_name: php7.4
extra_hosts:
#设置回环IP,可以通过此域名访问主机IP
- host.docker.internal:host-gateway
restart: always
# ports:
# - "9000:9000"
stdin_open: true
tty: true
environment:
- TZ=${TZ}
volumes:
- ${WWW_DIR}:/var/www
#- ./services/php7.4/etc/:/usr/local/etc/
- ./services/php7.4/etc/php.ini:/usr/local/etc/php/php.ini
- ./services/php7.4/etc/www.conf:/usr/local/etc/php-fpm.d/www.conf
- ./logs/php74:/var/log/php
networks:
- base_default
nvm:
build:
context: ./services/nvm
args:
CONTAINER_PACKAGE_URL: ${CONTAINER_PACKAGE_URL}
TZ: ${TZ}
container_name: nvm
restart: always
user: root
stdin_open: true
tty: true
ports:
- "3000-3010:3000-3010"
volumes:
- ${WWW_DIR}:/www/:cached
networks:
- base_default
# mysql8:
# image: mysql:8
# container_name: mysql8
# restart: always
# ports:
# - "3306:3306"
# command: --default-authentication-plugin=mysql_native_password
# volumes:
# - ./data/mysql:/var/lib/mysql
# environment:
# MYSQL_ROOT_PASSWORD: admin123123
# networks:
# - base_default
# hyperf:
# image: hyperf/hyperf:8.0-alpine-v3.15-swoole
# container_name: hyperf
# restart: always
# user: root
# stdin_open: true
# tty: true
# ports:
# - "9501:9501"
# volumes:
# - ./www/project:/data/project
# networks:
# - base_default
networks:
base_default:
external: true
本文档使用 521Wiki 发布