Update Dockerfile
Browse files- Dockerfile +5 -4
Dockerfile
CHANGED
|
@@ -8,19 +8,20 @@ ENV POSTGRES_USER=myuser \
|
|
| 8 |
VIRTUAL_ENV=/opt/venv \
|
| 9 |
PATH="$VIRTUAL_ENV/bin:$PATH"
|
| 10 |
|
| 11 |
-
#
|
| 12 |
RUN apt-get update && apt-get install -y \
|
| 13 |
python3 \
|
| 14 |
python3-pip \
|
| 15 |
python3-venv \
|
|
|
|
| 16 |
--no-install-recommends && \
|
| 17 |
apt-get clean && \
|
| 18 |
rm -rf /var/lib/apt/lists/*
|
| 19 |
|
| 20 |
-
#
|
| 21 |
RUN python3 -m venv $VIRTUAL_ENV && \
|
| 22 |
-
pip install --upgrade pip && \
|
| 23 |
-
pip install Flask psycopg2-binary
|
| 24 |
|
| 25 |
# 将应用程序代码和启动脚本复制到容器中
|
| 26 |
COPY app.py /app/app.py
|
|
|
|
| 8 |
VIRTUAL_ENV=/opt/venv \
|
| 9 |
PATH="$VIRTUAL_ENV/bin:$PATH"
|
| 10 |
|
| 11 |
+
# 更新包管理器,并安装必要的软件包,包括 Python3、venv 和 curl
|
| 12 |
RUN apt-get update && apt-get install -y \
|
| 13 |
python3 \
|
| 14 |
python3-pip \
|
| 15 |
python3-venv \
|
| 16 |
+
curl \
|
| 17 |
--no-install-recommends && \
|
| 18 |
apt-get clean && \
|
| 19 |
rm -rf /var/lib/apt/lists/*
|
| 20 |
|
| 21 |
+
# 创建虚拟环境并激活它,安装依赖包
|
| 22 |
RUN python3 -m venv $VIRTUAL_ENV && \
|
| 23 |
+
$VIRTUAL_ENV/bin/pip install --upgrade pip && \
|
| 24 |
+
$VIRTUAL_ENV/bin/pip install Flask psycopg2-binary
|
| 25 |
|
| 26 |
# 将应用程序代码和启动脚本复制到容器中
|
| 27 |
COPY app.py /app/app.py
|