mirror of
https://github.com/FxEmbed/FxEmbed.git
synced 2026-10-02 01:54:54 +08:00
fix(docker): run as dedicated user and not root
This commit is contained in:
+7
-1
@@ -27,8 +27,14 @@ FROM base AS runtime
|
||||
ENV NODE_ENV=production
|
||||
ENV WRANGLER_SEND_METRICS=false
|
||||
|
||||
COPY --from=build /app /app
|
||||
RUN groupadd --gid 1001 fxembed \
|
||||
&& useradd --uid 1001 --gid fxembed --home-dir /app --no-create-home --shell /usr/sbin/nologin fxembed
|
||||
|
||||
COPY --from=build --chown=fxembed:fxembed /app /app
|
||||
RUN chown fxembed:fxembed /app
|
||||
|
||||
EXPOSE 8787
|
||||
|
||||
USER fxembed
|
||||
|
||||
CMD ["npx", "wrangler", "dev", "./dist/worker.js", "--local", "--ip", "0.0.0.0", "--port", "8787"]
|
||||
|
||||
Reference in New Issue
Block a user