Update Dockerfile
Browse files- Dockerfile +4 -2
Dockerfile
CHANGED
@@ -14,10 +14,12 @@ ARG DB_POSTGRESDB_USER=$DB_POSTGRESDB_USER
|
|
14 |
ARG DB_POSTGRESDB_PASSWORD=$DB_POSTGRESDB_PASSWORD
|
15 |
|
16 |
# 显示构建参数(调试用)
|
17 |
-
RUN
|
|
|
|
|
18 |
|
19 |
# 设置 NC_DB 环境变量
|
20 |
-
ENV NC_DB="pg://${DB_POSTGRESDB_HOST}:${DB_POSTGRESDB_PORT}?u=$
|
21 |
|
22 |
RUN mkdir -p /usr/app /usr/src/app && \
|
23 |
chown -R node:node /usr/app /usr/src/app && \
|
|
|
14 |
ARG DB_POSTGRESDB_PASSWORD=$DB_POSTGRESDB_PASSWORD
|
15 |
|
16 |
# 显示构建参数(调试用)
|
17 |
+
RUN --mount=type=secret,id=DB_Host,mode=0444,required=true \
|
18 |
+
--mount=type=secret,id=DB_Port,mode=0444,required=true \
|
19 |
+
echo "Build args: CACHEBUST=${CACHEBUST}, DB_HOST=${DB_POSTGRESDB_HOST}, DB_PORT=${DB_POSTGRESDB_PORT}"
|
20 |
|
21 |
# 设置 NC_DB 环境变量
|
22 |
+
ENV NC_DB="pg://${DB_POSTGRESDB_HOST}:${DB_POSTGRESDB_PORT}?u=$(cat /run/secrets/DB_POSTGRESDB_USER)&p=$(cat /run/secrets/DB_POSTGRESDB_PASSWORD)&d=${DB_POSTGRESDB_DATABASE}"
|
23 |
|
24 |
RUN mkdir -p /usr/app /usr/src/app && \
|
25 |
chown -R node:node /usr/app /usr/src/app && \
|