智慧教务系统
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

104 lines
2.5 KiB

version: '3.8'
services:
# PHP 服务
php:
image: niucloud-php:8.2
container_name: niucloud_php
volumes:
- ./niucloud:/var/www/html
- ./docker/php/php.ini:/usr/local/etc/php/php.ini
- ./docker/php/www.conf:/usr/local/etc/php-fpm.d/www.conf
working_dir: /var/www/html
depends_on:
- mysql
- redis
environment:
- PHP_IDE_CONFIG=serverName=niucloud
networks:
- niucloud_network
# Nginx 服务
nginx:
image: nginx:alpine
container_name: niucloud_nginx
ports:
- "20080:80"
- "20081:8080"
volumes:
- ./niucloud:/var/www/html
- ./admin/dist:/var/www/admin
- ./docker/nginx/nginx.conf:/etc/nginx/nginx.conf
- ./docker/nginx/conf.d:/etc/nginx/conf.d
- ./docker/logs/nginx:/var/log/nginx
depends_on:
- php
- node
networks:
- niucloud_network
# MySQL 数据库
mysql:
image: mysql:8.0
container_name: niucloud_mysql
ports:
- "23306:3306"
environment:
MYSQL_ROOT_PASSWORD: root123456
MYSQL_DATABASE: niucloud
MYSQL_USER: niucloud
MYSQL_PASSWORD: niucloud123
volumes:
- ./docker/data/mysql:/var/lib/mysql
- ./docker/mysql/my.cnf:/etc/mysql/conf.d/my.cnf
- ./docker/logs/mysql:/var/log/mysql
command: --default-authentication-plugin=mysql_native_password
networks:
- niucloud_network
# Redis 缓存
redis:
image: redis:alpine
container_name: niucloud_redis
ports:
- "26379:6379"
volumes:
- ./docker/data/redis:/data
- ./docker/redis/redis.conf:/usr/local/etc/redis/redis.conf
command: redis-server /usr/local/etc/redis/redis.conf
networks:
- niucloud_network
# Node.js 服务 (用于构建前端)
node:
image: node:18-alpine
container_name: niucloud_node
working_dir: /app
volumes:
- ./admin:/app
- ./docker/data/node_modules:/app/node_modules
ports:
- "23000:5173" # 映射到 Vite 默认开发端口 5173
command: >
sh -c "
npm config set registry https://registry.npmmirror.com &&
npm install &&
npm run dev
"
networks:
- niucloud_network
# Composer 服务 (可选)
composer:
image: composer:latest
container_name: niucloud_composer
volumes:
- ./niucloud:/app
working_dir: /app
command: install --ignore-platform-reqs
networks:
- niucloud_network
networks:
niucloud_network:
driver: bridge