forked from zhouxiaoka/autoclip
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.dev
More file actions
54 lines (40 loc) · 1.12 KB
/
Dockerfile.dev
File metadata and controls
54 lines (40 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# AutoClip 开发环境 Dockerfile
FROM python:3.9-slim
# 设置环境变量
ENV PYTHONUNBUFFERED=1
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONPATH=/app
WORKDIR /app
# 安装系统依赖
RUN apt-get update && apt-get install -y \
build-essential \
curl \
ffmpeg \
git \
&& rm -rf /var/lib/apt/lists/*
# 安装Node.js
RUN curl -fsSL https://deb.nodesource.com/setup_18.x | bash - \
&& apt-get install -y nodejs
# 复制Python依赖文件
COPY requirements.txt ./
# 创建虚拟环境并安装Python依赖
RUN python3 -m venv venv
RUN . venv/bin/activate && pip install --upgrade pip
RUN . venv/bin/activate && pip install -r requirements.txt
# 复制前端依赖文件
COPY frontend/package*.json ./frontend/
# 安装前端依赖
RUN cd frontend && npm install && npm run build
# 复制项目文件
COPY . .
# 复制开发环境启动脚本
COPY docker-dev-entrypoint.sh ./
# 创建必要的目录
RUN mkdir -p data/projects data/uploads data/temp data/output logs
# 设置权限
RUN chmod +x *.sh
RUN chmod +x docker-dev-entrypoint.sh
# 暴露端口
EXPOSE 8000 3000
# 启动命令
CMD ["./docker-dev-entrypoint.sh"]