mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-14 14:06:15 +08:00
feat: Improvement- use non root user for Web container (#8928)
This commit is contained in:
parent
b933c9d206
commit
a8b4d1ac2a
@ -46,21 +46,27 @@ ENV TZ=UTC
|
|||||||
RUN ln -s /usr/share/zoneinfo/${TZ} /etc/localtime \
|
RUN ln -s /usr/share/zoneinfo/${TZ} /etc/localtime \
|
||||||
&& echo ${TZ} > /etc/timezone
|
&& echo ${TZ} > /etc/timezone
|
||||||
|
|
||||||
# global runtime packages
|
|
||||||
RUN yarn global add pm2 \
|
|
||||||
&& yarn cache clean
|
|
||||||
|
|
||||||
WORKDIR /app/web
|
WORKDIR /app/web
|
||||||
COPY --from=builder /app/web/public ./public
|
COPY --from=builder /app/web/public ./public
|
||||||
COPY --from=builder /app/web/.next/standalone ./
|
COPY --from=builder /app/web/.next/standalone ./
|
||||||
COPY --from=builder /app/web/.next/static ./.next/static
|
COPY --from=builder /app/web/.next/static ./.next/static
|
||||||
|
|
||||||
|
|
||||||
COPY docker/pm2.json ./pm2.json
|
COPY docker/pm2.json ./pm2.json
|
||||||
COPY docker/entrypoint.sh ./entrypoint.sh
|
COPY docker/entrypoint.sh ./entrypoint.sh
|
||||||
|
|
||||||
|
|
||||||
|
# global runtime packages
|
||||||
|
RUN yarn global add pm2 \
|
||||||
|
&& yarn cache clean \
|
||||||
|
&& mkdir /.pm2 \
|
||||||
|
&& chown -R 1001:0 /.pm2 /app/web \
|
||||||
|
&& chmod -R g=u /.pm2 /app/web
|
||||||
|
|
||||||
|
|
||||||
ARG COMMIT_SHA
|
ARG COMMIT_SHA
|
||||||
ENV COMMIT_SHA=${COMMIT_SHA}
|
ENV COMMIT_SHA=${COMMIT_SHA}
|
||||||
|
|
||||||
|
USER 1001
|
||||||
EXPOSE 3000
|
EXPOSE 3000
|
||||||
ENTRYPOINT ["/bin/sh", "./entrypoint.sh"]
|
ENTRYPOINT ["/bin/sh", "./entrypoint.sh"]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user