version: "3.7"
services:
521php_nginx:
image: nginx:1.23.3
container_name: 521php_nginx
depends_on:
- 521php_php
extra_hosts:
#设置回环IP,可以通过此域名访问主机IP
- host.docker.internal:host-gateway
restart: always
ports:
- "80:80"
- "443:443"
volumes:
- ./services/nginx/conf/nginx.conf:/etc/nginx/nginx.conf
- ./services/nginx/conf/conf.d:/etc/nginx/conf.d
- ./services/nginx/cert:/home/cert #https证书
- ./logs/nginx:/var/log/nginx
- ./www:/usr/share/nginx/html
# command:
# - sh
# - -c
# - |
# /usr/share/nginx/mindoc/mindoc_linux_amd64 &
# nginx -g "daemon off;"
# entrypoint:
# - /usr/share/nginx/mindoc/mindoc_linux_amd64
networks:
- default
521php_php:
build:
context: ./services/php
container_name: 521php_php
restart: always
volumes:
- ./services/php/etc:/usr/local/etc
- ./logs/php:/var/log/php
- ./www:/var/www
networks:
- default
521php_centos7:
image: centos:centos7
container_name: 521php_centos7
restart: always
# ports:
# - "80:80"
volumes:
- ./www/mindoc:/home/www/mindoc
command:
- sh
- -c
- |
/home/www/mindoc/mindoc_linux_amd64
networks:
- default
521php_mysql5:
image: mysql:5.5.48
container_name: 521php_mysql5
restart: always
ports:
- "3306:3306"
#command: --default-authentication-plugin=mysql_native_password
volumes:
- ./data/mysql:/var/lib/mysql
environment:
MYSQL_ROOT_PASSWORD: xxxxx
networks:
- default
networks:
default:
本文档使用 521Wiki 发布