Update Dockerfile
Browse files- Dockerfile +12 -6
Dockerfile
CHANGED
@@ -11,15 +11,21 @@ ENV POSTGRES_USER=myuser \
|
|
11 |
# 切换到 root 用户进行安装和用户修改
|
12 |
USER root
|
13 |
|
14 |
-
# 更新包管理器并安装必要软件包,包括 Python3、venv
|
15 |
RUN apt-get update && apt-get install -y \
|
16 |
python3 \
|
17 |
python3-pip \
|
18 |
python3-venv \
|
19 |
-
curl
|
20 |
-
|
21 |
-
|
22 |
-
rm -rf /var/lib/apt/lists/*
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
|
24 |
# 更改现有的 postgres 用户 UID 和 GID 为 1000
|
25 |
RUN usermod -u 1000 postgres && groupmod -g 1000 postgres
|
@@ -44,7 +50,7 @@ USER root
|
|
44 |
# 创建虚拟环境并安装 Python 包
|
45 |
RUN python3 -m venv $VIRTUAL_ENV && \
|
46 |
$VIRTUAL_ENV/bin/pip install --upgrade pip && \
|
47 |
-
$VIRTUAL_ENV/bin/pip install
|
48 |
|
49 |
# 将应用程序代码和启动脚本复制到容器中
|
50 |
COPY app.py /app/app.py
|
|
|
11 |
# 切换到 root 用户进行安装和用户修改
|
12 |
USER root
|
13 |
|
14 |
+
# 更新包管理器并安装必要软件包,包括 Python3、venv、curl、Node.js、n8n
|
15 |
RUN apt-get update && apt-get install -y \
|
16 |
python3 \
|
17 |
python3-pip \
|
18 |
python3-venv \
|
19 |
+
curl \
|
20 |
+
gosu \
|
21 |
+
build-essential \
|
22 |
+
&& apt-get clean && rm -rf /var/lib/apt/lists/*
|
23 |
+
|
24 |
+
# 安装 Node.js 及 n8n
|
25 |
+
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \
|
26 |
+
apt-get install -y nodejs && \
|
27 |
+
npm install -g n8n && \
|
28 |
+
apt-get clean && rm -rf /var/lib/apt/lists/*
|
29 |
|
30 |
# 更改现有的 postgres 用户 UID 和 GID 为 1000
|
31 |
RUN usermod -u 1000 postgres && groupmod -g 1000 postgres
|
|
|
50 |
# 创建虚拟环境并安装 Python 包
|
51 |
RUN python3 -m venv $VIRTUAL_ENV && \
|
52 |
$VIRTUAL_ENV/bin/pip install --upgrade pip && \
|
53 |
+
$VIRTUAL_ENV/bin/pip install psycopg2-binary
|
54 |
|
55 |
# 将应用程序代码和启动脚本复制到容器中
|
56 |
COPY app.py /app/app.py
|