1 Star 0 Fork 3

朱建辉/docker-compose-php-lnmp-swoole

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
docker-compose.yml.example8 2.37 KB
一键复制 编辑 原始数据 按行查看 历史
version: '3.8'
services:
php:
build:
context: ./php/php8
container_name: ${CONTAINER_NAME_PREFIX}-php
expose:
- 9000
volumes:
- "/www/app:/var/www/html:rw"
#挂载php配置文件
- "/www/php/php8/conf:/etc/php8"
#挂载php日志
- "/www/php/php8/logs:/var/log/php8"
stdin_open: true
tty: true
depends_on:
- redis
- db
networks:
- app_net
nginx:
# image: nginx:${NGINX_TAG}
image: nginx:${NGINX_TAG}-alpine
container_name: ${CONTAINER_NAME_PREFIX}-nginx
# 挂载宿主机端口8030
ports:
- "${NGINX_PORT}:80"
- "443:443"
volumes:
# 挂载nginx目录
- "/www/app:/var/www/html:rw"
# 挂载nginx日志
- "/www/nginx/logs:/var/log/nginx:rw"
# 挂载nginx配置文件
- "/www/nginx/conf/nginx.conf:/etc/nginx/nginx.conf:ro"
# 挂载虚拟主机配置文件
- "/www/nginx/conf/conf.d:/etc/nginx/conf.d/:ro"
# 映射ssl
- "/www/nginx/certs:/etc/nginx/certs/:ro"
environment:
- TZ=Asia/Shanghai
depends_on:
- php
restart: always
networks:
- app_net
db:
image: ${DB_NAME}
container_name: ${CONTAINER_NAME_PREFIX}-mysql
# 暴露端口
ports:
- "${MYSQL_PORT}:3306"
# 数据库数据挂载
volumes:
- "/www/db/${DB_PATH}/init:/docker-entrypoint-initdb.d"
- "/www/db/${DB_PATH}/data:/var/lib/mysql"
- "/www/db/${DB_PATH}/logs:/var/log/mysql"
- "/www/db/${DB_PATH}/my.cnf:/etc/my.cnf"
environment:
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
MYSQL_DATABASE: ${MYSQL_DATABASE}
MYSQL_USER: ${MYSQL_USER}
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
command: --default-authentication-plugin=mysql_native_password
restart: always
networks:
- app_net
redis:
image: redis:${REDIS_TAG}-alpine
container_name: ${CONTAINER_NAME_PREFIX}-redis
ports:
- "${REDIS_PORT}:6379"
volumes:
- "/www/redis/conf:/etc/redis"
- "/www/redis/data:/data"
command: redis-server /etc/redis/redis.conf
restart: always
networks:
- app_net
portainer:
image: portainer/portainer:latest
container_name: ${CONTAINER_NAME_PREFIX}-portainer
ports:
- "9030:9000"
volumes:
- /www/portainer/data:/data
- /var/run/docker.sock:/var/run/docker.sock
networks:
app_net:
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Docker
1
https://gitee.com/yushen123/docker-compose-lnmp-swoole.git
git@gitee.com:yushen123/docker-compose-lnmp-swoole.git
yushen123
docker-compose-lnmp-swoole
docker-compose-php-lnmp-swoole
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385