Create Dockerfile
Browse files- Dockerfile +20 -0
Dockerfile
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
FROM python:3.9-slim
|
2 |
+
|
3 |
+
WORKDIR /code
|
4 |
+
|
5 |
+
# 安装依赖
|
6 |
+
COPY requirements.txt .
|
7 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
8 |
+
|
9 |
+
# 复制应用代码
|
10 |
+
COPY . .
|
11 |
+
|
12 |
+
# 设置环境变量
|
13 |
+
ENV PORT=7860
|
14 |
+
ENV TARGET_DOMAIN="https://generativelanguage.googleapis.com"
|
15 |
+
|
16 |
+
# 暴露端口
|
17 |
+
EXPOSE 7860
|
18 |
+
|
19 |
+
# 启动命令
|
20 |
+
CMD ["python", "app.py"]
|