mirror of
https://github.com/fastapiadmin/FastapiAdmin.git
synced 2026-09-21 04:46:26 +00:00
Vendored
+1
-1
@@ -6,7 +6,7 @@ ENVIRONMENT = "dev"
|
|||||||
|
|
||||||
# 服务器配置
|
# 服务器配置
|
||||||
SERVER_HOST = '0.0.0.0' # 允许访问的IP地址
|
SERVER_HOST = '0.0.0.0' # 允许访问的IP地址
|
||||||
SERVER_PORT = 8000 # 服务端口
|
SERVER_PORT = 8001 # 服务端口
|
||||||
RELOAD = True # 是否自动重启
|
RELOAD = True # 是否自动重启
|
||||||
WORKERS = 1 # 启动进程数
|
WORKERS = 1 # 启动进程数
|
||||||
FACTORY = True # 是否使用异步模式
|
FACTORY = True # 是否使用异步模式
|
||||||
|
|||||||
Vendored
+2
-2
@@ -5,8 +5,8 @@
|
|||||||
ENVIRONMENT = "prod"
|
ENVIRONMENT = "prod"
|
||||||
|
|
||||||
# 服务器配置
|
# 服务器配置
|
||||||
SERVER_HOST = '172.18.52.77' # 允许访问的IP地址
|
SERVER_HOST = '0.0.0.0' # 允许访问的IP地址
|
||||||
SERVER_PORT = 8000 # 服务端口
|
SERVER_PORT = 8001 # 服务端口
|
||||||
RELOAD = False # 是否自动重启
|
RELOAD = False # 是否自动重启
|
||||||
WORKERS = 1 # 启动进程数
|
WORKERS = 1 # 启动进程数
|
||||||
FACTORY = True # 是否使用异步模式
|
FACTORY = True # 是否使用异步模式
|
||||||
|
|||||||
Executable → Regular
@@ -11,10 +11,10 @@ ENV TZ Asia/Shanghai
|
|||||||
WORKDIR /home
|
WORKDIR /home
|
||||||
|
|
||||||
# 将当前主机目录全部文件复制至容器工作目录
|
# 将当前主机目录全部文件复制至容器工作目录
|
||||||
COPY /home/fastapi_vue3_admin/backend .
|
COPY ../backend .
|
||||||
|
|
||||||
# 安装依赖
|
# 安装依赖
|
||||||
RUN pip install --no-cache-dir -r ./backend/requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
|
RUN pip install --no-cache-dir -r ./requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
|
||||||
|
|
||||||
# 运行应用
|
# 运行应用
|
||||||
CMD ["python", "main.py", "run", "--env=prod"]
|
CMD ["python", "main.py", "run", "--env=prod"]
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
version: "3.0"
|
version: "3.10"
|
||||||
|
|
||||||
# 应用服务
|
# 应用服务
|
||||||
services:
|
services:
|
||||||
@@ -42,11 +42,11 @@ services:
|
|||||||
container_name: backend
|
container_name: backend
|
||||||
# 构建镜像
|
# 构建镜像
|
||||||
build:
|
build:
|
||||||
context: ./backend
|
context: ..
|
||||||
dockerfile: Dockerfile
|
dockerfile: devops/backend/Dockerfile
|
||||||
# 端口映射
|
# 端口映射
|
||||||
ports:
|
ports:
|
||||||
- "8000:8000"
|
- "8001:8001"
|
||||||
volumes:
|
volumes:
|
||||||
- /home/backend/static:/home/backend/static
|
- /home/backend/static:/home/backend/static
|
||||||
- /home/backend/logs:/home/backend/logs
|
- /home/backend/logs:/home/backend/logs
|
||||||
|
|||||||
@@ -11,10 +11,10 @@ ENV TZ Asia/Shanghai
|
|||||||
WORKDIR /home
|
WORKDIR /home
|
||||||
|
|
||||||
# 将当前主机目录全部文件复制至容器工作目录
|
# 将当前主机目录全部文件复制至容器工作目录
|
||||||
COPY /home/fastapi_vue3_admin/devops/frontend/dist /usr/share/nginx/html
|
COPY ./dist /usr/share/nginx/html
|
||||||
|
|
||||||
# 用本地的nginx配置文件覆盖镜像的Nginx配置
|
# 用本地的nginx配置文件覆盖镜像的Nginx配置
|
||||||
COPY /home/fastapi_vue3_admin/devops/frontend/nginx.conf /etc/nginx/nginx.conf
|
COPY ./nginx.conf /etc/nginx/nginx.conf
|
||||||
|
|
||||||
# 暴露端口
|
# 暴露端口
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
########### 每个指令必须有分号结束。#################
|
########### 每个指令必须有分号结束。#################
|
||||||
user administrator administrators; # 配置用户或组,默认为nobody nobody
|
worker_processes 1; # 允许生成的进程数,默认为1:
|
||||||
worker_processes 1; # 允许生成的进程数,默认为1
|
|
||||||
pid /nginx/pid/nginx.pid; # 指定 Nginx 进程运行文件存放地址
|
pid /nginx/pid/nginx.pid; # 指定 Nginx 进程运行文件存放地址
|
||||||
|
|
||||||
error_log /var/log/nginx/error.log warn;
|
error_log /var/log/nginx/error.log warn;
|
||||||
@@ -18,7 +17,7 @@ http {
|
|||||||
|
|
||||||
# 访问服务日志
|
# 访问服务日志
|
||||||
access_log on;
|
access_log on;
|
||||||
access_log /var/log/nginx/host.access.log main;
|
access_log /var/log/nginx/host.access.log info;
|
||||||
|
|
||||||
sendfile on; # 允许sendfile方式传输文件,默认为off,可以在http块、server块、location块
|
sendfile on; # 允许sendfile方式传输文件,默认为off,可以在http块、server块、location块
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ VITE_APP_TITLE=开发环境
|
|||||||
VITE_APP_BASE_API=/api/v1
|
VITE_APP_BASE_API=/api/v1
|
||||||
|
|
||||||
# 网络请求公用地址
|
# 网络请求公用地址
|
||||||
VITE_API_BASE_URL=http://localhost:8000
|
VITE_API_BASE_URL=http://localhost:8001
|
||||||
|
|
||||||
# 请求超时时间
|
# 请求超时时间
|
||||||
VITE_TIMEOUT=10000
|
VITE_TIMEOUT=10000
|
||||||
Reference in New Issue
Block a user