fix: run container as non-root user (node)
Build & Push Docker Image / build (push) Successful in 20s
Build & Push Docker Image / build (push) Successful in 20s
This commit is contained in:
+4
-1
@@ -15,7 +15,8 @@ COPY server/src/ ./server/src/
|
||||
RUN cd server && npm ci && npx tsc
|
||||
|
||||
FROM node:22-slim
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates && rm -rf /var/lib/apt/lists/*
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates && rm -rf /var/lib/apt/lists/* && \
|
||||
mkdir -p /app /data && chown -R node:node /app /data
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
@@ -25,6 +26,8 @@ COPY --from=server-build /app/server/node_modules ./server/node_modules
|
||||
|
||||
COPY .env.example ./.env.example
|
||||
|
||||
USER node
|
||||
|
||||
EXPOSE 3001
|
||||
VOLUME ["/data"]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user