mirror of
https://github.com/fastapiadmin/FastapiAdmin.git
synced 2026-09-20 20:39:55 +00:00
refactor(devops): 重构 Docker 配置和目录结构
- 移除旧的 `Dockerfile` 和 `nginx.conf`,新增独立的 `frontend` 和 `backend` Dockerfile - 更新 `docker-compose.yaml`,简化服务配置并优化网络和卷挂载 - 移除 `start.sh` 和 `stop.sh` 脚本,简化部署流程 - 将环境配置文件移动到 `backend/env` 目录,并移除旧的 `.env` 文件 - 更新 `backend/app/config/setting.py` 以适配新的环境配置文件路径
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
# 使用官方的 Python 3.10 镜像作为基础镜像
|
||||
FROM python:3.10
|
||||
|
||||
# 使用 LABEL 替代 MAINTAINER
|
||||
LABEL maintainer="948080782@qq.com"
|
||||
|
||||
# 设置时区
|
||||
ENV TZ Asia/Shanghai
|
||||
|
||||
# 设置容器内工作目录
|
||||
WORKDIR /home
|
||||
|
||||
# 将当前主机目录全部文件复制至容器工作目录
|
||||
COPY /home/fastapi_vue3_admin/backend .
|
||||
|
||||
# 安装依赖
|
||||
RUN pip install --no-cache-dir -r ./backend/requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
|
||||
|
||||
# 运行应用
|
||||
CMD ["python", "main.py", "run", "--env=prod"]
|
||||
|
||||
# 暴露端口
|
||||
EXPOSE 8000
|
||||
Reference in New Issue
Block a user