Skip to content

Commit

Permalink
Create docker user with specific -u + make root own files
Browse files Browse the repository at this point in the history
  • Loading branch information
HDegroote committed Sep 11, 2024
1 parent adf5fd8 commit 3f92fb6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions Dockerfile-client
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
FROM node:20-slim

RUN useradd p2proxy
USER p2proxy
RUN useradd -u 17218 p2proxy

ENV WORKDIR=/home/p2proxy/

Expand All @@ -11,4 +10,6 @@ COPY package.json ${WORKDIR}
COPY index.js ${WORKDIR}
COPY client.js ${WORKDIR}

USER p2proxy

ENTRYPOINT ["/home/p2proxy/client.js"]
5 changes: 3 additions & 2 deletions Dockerfile-server
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
FROM node:20-slim

RUN useradd p2proxy
USER p2proxy
RUN useradd -u 1723 p2proxy

ENV WORKDIR=/home/p2proxy/

Expand All @@ -11,4 +10,6 @@ COPY package.json ${WORKDIR}
COPY index.js ${WORKDIR}
COPY server.js ${WORKDIR}

USER p2proxy

ENTRYPOINT ["/home/p2proxy/server.js"]

0 comments on commit 3f92fb6

Please sign in to comment.