wuliya
commited on
build(Dockerfile): 优化 Docker 镜像构建过程
Browse files- 移除了不必要的 MEME_DIRS 环境变量
- 删除了创建和设置所有权的 /home/user/.config/meme_generator 目录的步骤
- 简化了 RUN 命令,减少了镜像层数
- Dockerfile +4 -5
Dockerfile
CHANGED
|
@@ -6,12 +6,11 @@ USER user
|
|
| 6 |
RUN curl -sSL https://install.python-poetry.org | python3 -
|
| 7 |
|
| 8 |
ENV PATH="${PATH}:/home/user/.local/bin" \
|
| 9 |
-
PORT="7860"
|
| 10 |
-
MEME_DIRS="[\"/app/temp\"]"
|
| 11 |
|
| 12 |
-
WORKDIR /app
|
|
|
|
| 13 |
|
| 14 |
-
RUN mkdir -p /home/user/.config/meme_generator && \
|
| 15 |
-
chown -R user:user /home/user/.config/meme_generator
|
| 16 |
RUN poetry install
|
|
|
|
| 17 |
EXPOSE $PORT
|
|
|
|
| 6 |
RUN curl -sSL https://install.python-poetry.org | python3 -
|
| 7 |
|
| 8 |
ENV PATH="${PATH}:/home/user/.local/bin" \
|
| 9 |
+
PORT="7860"
|
|
|
|
| 10 |
|
| 11 |
+
WORKDIR /app
|
| 12 |
+
RUN ls /app/
|
| 13 |
|
|
|
|
|
|
|
| 14 |
RUN poetry install
|
| 15 |
+
|
| 16 |
EXPOSE $PORT
|