mirror of
https://github.com/LyLme/lylme_spage.git
synced 2024-11-17 14:34:08 +08:00
65 lines
1.5 KiB
YAML
65 lines
1.5 KiB
YAML
version: '3'
|
|
services:
|
|
php:
|
|
container_name: "spage-php74"
|
|
build: ./php
|
|
image: php74-fpm-alpine
|
|
# ports:
|
|
# - "9000:9000" #fpm 端口
|
|
restart: always
|
|
volumes:
|
|
- ./php/etc:/usr/local/etc/php/conf.d #映射配置文件
|
|
- ./www:/var/www/html
|
|
stdin_open: true
|
|
tty: true
|
|
links:
|
|
- "mysql" #链接mysql服务
|
|
networks:
|
|
spage:
|
|
ipv4_address: 10.10.10.2
|
|
environment:
|
|
- TZ=Asia/Shanghai # 设置时区
|
|
nginx:
|
|
container_name: "spage-nginx"
|
|
image: nginx:latest
|
|
restart: always
|
|
ports:
|
|
- "8080:80"
|
|
environment:
|
|
- TZ=Asia/Shanghai
|
|
depends_on:
|
|
- "php"
|
|
links:
|
|
- "php"
|
|
volumes:
|
|
- ./nginx/conf.d:/etc/nginx/conf.d
|
|
#- ./nginx/conf/nginx.conf:/etc/nginx/nginx.conf
|
|
- ./nginx/log:/var/log/nginx/
|
|
- ./www:/var/www/html
|
|
networks:
|
|
spage:
|
|
ipv4_address: 10.10.10.10 #分配ip
|
|
mysql:
|
|
container_name: "spage-mysql"
|
|
image: mysql:5.7
|
|
# ports:
|
|
# - ":3306"
|
|
volumes:
|
|
- ./mysql/data:/var/lib/mysql #数据目录
|
|
restart: always
|
|
environment:
|
|
- TZ=Asia/Shanghai
|
|
- MYSQL_ROOT_PASSWORD=123456 #MySQL root密码
|
|
- MYSQL_DATABASE=spage #MySQL 数据库名
|
|
networks:
|
|
spage:
|
|
ipv4_address: 10.10.10.1 #MySQL ip地址
|
|
networks:
|
|
spage:
|
|
driver: bridge
|
|
driver_opts:
|
|
com.docker.network.enable_ipv6: "true"
|
|
ipam:
|
|
config:
|
|
- subnet: 10.10.0.0/16
|