mirror of
https://github.com/PlayEdu/PlayEdu
synced 2025-10-26 14:42:59 +08:00
compose
This commit is contained in:
18
docker/mysql/Dockerfile
Normal file
18
docker/mysql/Dockerfile
Normal file
@@ -0,0 +1,18 @@
|
||||
FROM mysql:8.1
|
||||
|
||||
# 时区配置
|
||||
ARG TZ=UTC
|
||||
ENV TZ ${TIMEZONE}
|
||||
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ >/etc/timezone && chown -R mysql:root /var/lib/mysql/
|
||||
|
||||
# 复制自定义的my.cnf
|
||||
COPY my.cnf /etc/mysql/conf.d/my.cnf
|
||||
|
||||
# my.cnf只读权限
|
||||
RUN chmod 0444 /etc/mysql/conf.d/my.cnf
|
||||
|
||||
# 暴露3306端口
|
||||
EXPOSE 3306
|
||||
|
||||
# 启动mysql
|
||||
CMD ["mysqld"]
|
||||
12
docker/mysql/my.cnf
Normal file
12
docker/mysql/my.cnf
Normal file
@@ -0,0 +1,12 @@
|
||||
# The MySQL Client configuration file.
|
||||
#
|
||||
# For explanations see
|
||||
# http://dev.mysql.com/doc/mysql/en/server-system-variables.html
|
||||
|
||||
[mysql]
|
||||
default-character-set=utf8mb4
|
||||
|
||||
[mysqld]
|
||||
sql-mode="STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION"
|
||||
character-set-server=utf8mb4
|
||||
default-authentication-plugin=mysql_native_password
|
||||
131
docker/nginx/conf/nginx.conf
Normal file
131
docker/nginx/conf/nginx.conf
Normal file
@@ -0,0 +1,131 @@
|
||||
client_max_body_size 50m;
|
||||
|
||||
server {
|
||||
# 监听端口号9800
|
||||
listen 9800;
|
||||
# 禁用绝对重定向
|
||||
# 如果没有设置该配置项,当Nginx重定向时,它将使用绝对路径,这意味着当用户访问一个虚拟主机时
|
||||
# Nginx可能会将他们重定向到另一个主机的URL,这可能会导致安全问题和用户体验问题。因此,通过
|
||||
# 设置 absolute_redirect off ,Nginx将使用相对路径进行重定向,以确保用户在同一主机上进
|
||||
# 行重定向,而不会遇到上述问题。
|
||||
absolute_redirect off;
|
||||
# 匹配任何主机名
|
||||
server_name _;
|
||||
# 指定Web应用程序的根目录
|
||||
root /app/pc;
|
||||
# 指定默认的索引文件为index.html
|
||||
index index.html;
|
||||
# 启用gzip压缩
|
||||
gzip on;
|
||||
gzip_static on;
|
||||
gzip_buffers 4 16k;
|
||||
gzip_http_version 1.1;
|
||||
gzip_comp_level 5;
|
||||
gzip_types text/plain application/javascript text/css application/xml text/javascript;
|
||||
gzip_vary on;
|
||||
|
||||
# 将所有以/api/开头的请求代理到本地地址为127.0.0.1:9898的Web应用程序后端服务器
|
||||
location /api/ {
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_pass http://127.0.0.1:9898/;
|
||||
}
|
||||
|
||||
# 处理所有不以/api/开头的请求,尝试查找匹配的文件,如果没有找到则返回index.html
|
||||
location ~* ^/(?![api].*) {
|
||||
try_files $uri /index.html;
|
||||
}
|
||||
}
|
||||
|
||||
server {
|
||||
# 监听端口号9801
|
||||
listen 9801;
|
||||
# 禁用绝对重定向
|
||||
# 如果没有设置该配置项,当Nginx重定向时,它将使用绝对路径,这意味着当用户访问一个虚拟主机时
|
||||
# Nginx可能会将他们重定向到另一个主机的URL,这可能会导致安全问题和用户体验问题。因此,通过
|
||||
# 设置 absolute_redirect off ,Nginx将使用相对路径进行重定向,以确保用户在同一主机上进
|
||||
# 行重定向,而不会遇到上述问题。
|
||||
absolute_redirect off;
|
||||
# 匹配任何主机名
|
||||
server_name _;
|
||||
# 指定Web应用程序的根目录
|
||||
root /app/h5;
|
||||
# 指定默认的索引文件为index.html
|
||||
index index.html;
|
||||
# 启用gzip压缩
|
||||
gzip on;
|
||||
gzip_static on;
|
||||
gzip_buffers 4 16k;
|
||||
gzip_http_version 1.1;
|
||||
gzip_comp_level 5;
|
||||
gzip_types text/plain application/javascript text/css application/xml text/javascript;
|
||||
gzip_vary on;
|
||||
|
||||
# 将所有以/api/开头的请求代理到本地地址为127.0.0.1:9898的Web应用程序后端服务器
|
||||
location /api/ {
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_pass http://127.0.0.1:9898/;
|
||||
}
|
||||
|
||||
# 处理所有不以/api/开头的请求,尝试查找匹配的文件,如果没有找到则返回index.html
|
||||
location ~* ^/(?![api].*) {
|
||||
try_files $uri /index.html;
|
||||
}
|
||||
}
|
||||
|
||||
server {
|
||||
# 监听端口号9900
|
||||
listen 9900;
|
||||
# 禁用绝对重定向
|
||||
# 如果没有设置该配置项,当Nginx重定向时,它将使用绝对路径,这意味着当用户访问一个虚拟主机时
|
||||
# Nginx可能会将他们重定向到另一个主机的URL,这可能会导致安全问题和用户体验问题。因此,通过
|
||||
# 设置 absolute_redirect off ,Nginx将使用相对路径进行重定向,以确保用户在同一主机上进
|
||||
# 行重定向,而不会遇到上述问题。
|
||||
absolute_redirect off;
|
||||
# 匹配任何主机名
|
||||
server_name _;
|
||||
# 指定Web应用程序的根目录
|
||||
root /app/admin;
|
||||
# 指定默认的索引文件为index.html
|
||||
index index.html;
|
||||
# 启用gzip压缩
|
||||
gzip on;
|
||||
gzip_static on;
|
||||
gzip_buffers 4 16k;
|
||||
gzip_http_version 1.1;
|
||||
gzip_comp_level 5;
|
||||
gzip_types text/plain application/javascript text/css application/xml text/javascript;
|
||||
gzip_vary on;
|
||||
|
||||
# 将所有以/api/开头的请求代理到本地地址为127.0.0.1:9898的Web应用程序后端服务器
|
||||
location /api/ {
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_pass http://127.0.0.1:9898/;
|
||||
}
|
||||
|
||||
# 处理所有不以/api/开头的请求,尝试查找匹配的文件,如果没有找到则返回index.html
|
||||
location ~* ^/(?![api].*) {
|
||||
try_files $uri /index.html;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
server {
|
||||
# 监听端口号80
|
||||
listen 9700;
|
||||
# 匹配任何主机名
|
||||
server_name _;
|
||||
# 指定Web应用程序的根目录
|
||||
root /app/pc;
|
||||
# 指定默认的索引文件为index.html
|
||||
index index.html;
|
||||
|
||||
# 将所有请求代理到本地地址为127.0.0.1:9898的Web应用程序后端服务器
|
||||
location / {
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_pass http://127.0.0.1:9898/;
|
||||
}
|
||||
}
|
||||
9
docker/redis/Dockerfile
Normal file
9
docker/redis/Dockerfile
Normal file
@@ -0,0 +1,9 @@
|
||||
FROM redis:7.0.12
|
||||
|
||||
COPY redis.conf /usr/local/etc/redis/redis.conf
|
||||
|
||||
VOLUME /data
|
||||
|
||||
EXPOSE 6379
|
||||
|
||||
CMD ["redis-server", "/usr/local/etc/redis/redis.conf"]
|
||||
1377
docker/redis/redis.conf
Normal file
1377
docker/redis/redis.conf
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user