签入版本

This commit is contained in:
2026-09-12 12:07:15 +08:00
commit 0277034d24
939 changed files with 129356 additions and 0 deletions
+34
View File
@@ -0,0 +1,34 @@
# 基础镜像
FROM python:3.9
# 镜像作者
MAINTAINER 管理员
# 设置 python 环境变量
ENV PYTHONUNBUFFERED 1
ENV PYTHONDONTWRITEBYTECODE 1
# 设置时区
ENV TZ Asia/Shanghai
# 更新pip
RUN pip install -U pip
# 设置国内镜像源
RUN pip config set global.index-url http://mirrors.aliyun.com/pypi/simple
RUN pip config set install.trusted-host mirrors.aliyun.com
# 升级pip版本
RUN python -m pip install --upgrade pip
# 安装工具
RUN pip install setuptools
# 创建容器工作目录
RUN mkdir -p /data/apps
# 设置容器内工作目录
WORKDIR /data/apps
# 将当前主机目录全部文件复制至容器工作目录
ADD .. /data/apps
# 也可以单个拷贝
# COPY ./requirements.txt .
# 安装依赖
RUN pip install -r requirements.txt
RUN pip install uwsgi
+39
View File
@@ -0,0 +1,39 @@
version: '3.7'
# 应用服务
services:
# 后端服务
django_naivevue:
# 镜像名称
image: django_naivevue
# 容器名称
container_name: django_naivevue
# 构建镜像
build:
context: ..
dockerfile: Dockerfile
#build: .
# 将容器运行在特权模式下,意味着容器内的进程将具
# 有访问宿主机的权限,包括文件系统、设备和系统功能等
privileged: true
# 指定容器中运行的用户
user: root
# 启动策略为始终重启
restart: always
# 设置网络模式为host模式
network_mode: host
# 端口映射
ports:
- 8011:8011
# 文件挂载
volumes:
- ./:/data/apps
- ./public/uploads:/data/apps/uploads
# 执行命令
command: python manage.py runserver 0.0.0.0:8011 --noreload
# 日志配置
logging:
driver: "json-file"
options:
max-size: "500m"
max-file: "10"