Use non root for containers
This commit is contained in:
@@ -32,12 +32,20 @@ ENV WHITELIST_LIBRARY_TYPE ''
|
|||||||
ENV BLACKLIST_USERS ''
|
ENV BLACKLIST_USERS ''
|
||||||
ENV WHITELIST_USERS ''
|
ENV WHITELIST_USERS ''
|
||||||
|
|
||||||
|
|
||||||
|
RUN addgroup --system jellyplex_user && \
|
||||||
|
adduser --system --no-create-home jellyplex_user --ingroup jellyplex_user && \
|
||||||
|
mkdir -p /app && \
|
||||||
|
chown -R jellyplex_user:jellyplex_user /app
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
COPY ./requirements.txt ./
|
COPY --chown=jellyplex_user:jellyplex_user ./requirements.txt ./
|
||||||
|
|
||||||
RUN pip install --no-cache-dir -r requirements.txt
|
RUN pip install --no-cache-dir -r requirements.txt
|
||||||
|
|
||||||
COPY . .
|
COPY --chown=jellyplex_user:jellyplex_user . .
|
||||||
|
|
||||||
|
USER jellyplex_user
|
||||||
|
|
||||||
CMD ["python", "-u", "main.py"]
|
CMD ["python", "-u", "main.py"]
|
||||||
|
|||||||
@@ -32,12 +32,20 @@ ENV WHITELIST_LIBRARY_TYPE ''
|
|||||||
ENV BLACKLIST_USERS ''
|
ENV BLACKLIST_USERS ''
|
||||||
ENV WHITELIST_USERS ''
|
ENV WHITELIST_USERS ''
|
||||||
|
|
||||||
|
|
||||||
|
RUN addgroup --system jellyplex_user && \
|
||||||
|
adduser --system --no-create-home jellyplex_user --ingroup jellyplex_user && \
|
||||||
|
mkdir -p /app && \
|
||||||
|
chown -R jellyplex_user:jellyplex_user /app
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
COPY ./requirements.txt ./
|
COPY --chown=jellyplex_user:jellyplex_user ./requirements.txt ./
|
||||||
|
|
||||||
RUN pip install --no-cache-dir -r requirements.txt
|
RUN pip install --no-cache-dir -r requirements.txt
|
||||||
|
|
||||||
COPY . .
|
COPY --chown=jellyplex_user:jellyplex_user . .
|
||||||
|
|
||||||
|
USER jellyplex_user
|
||||||
|
|
||||||
CMD ["python", "-u", "main.py"]
|
CMD ["python", "-u", "main.py"]
|
||||||
|
|||||||
Reference in New Issue
Block a user