security(atlasbot): run images as non-root
This commit is contained in:
parent
7908019fc7
commit
48c639e651
@ -11,6 +11,9 @@ COPY pyproject.toml /app/pyproject.toml
|
|||||||
RUN pip install --no-cache-dir --retries 10 -r /app/requirements.txt
|
RUN pip install --no-cache-dir --retries 10 -r /app/requirements.txt
|
||||||
|
|
||||||
COPY atlasbot /app/atlasbot
|
COPY atlasbot /app/atlasbot
|
||||||
|
RUN addgroup --system atlasbot && \
|
||||||
|
adduser --system --ingroup atlasbot --home /app atlasbot && \
|
||||||
|
chown -R atlasbot:atlasbot /app
|
||||||
|
|
||||||
FROM base AS test
|
FROM base AS test
|
||||||
COPY requirements-dev.txt /app/requirements-dev.txt
|
COPY requirements-dev.txt /app/requirements-dev.txt
|
||||||
@ -21,4 +24,5 @@ COPY scripts /app/scripts
|
|||||||
|
|
||||||
FROM base AS runtime
|
FROM base AS runtime
|
||||||
EXPOSE 8090
|
EXPOSE 8090
|
||||||
|
USER atlasbot
|
||||||
CMD ["python", "-m", "atlasbot.main"]
|
CMD ["python", "-m", "atlasbot.main"]
|
||||||
|
|||||||
@ -6,4 +6,9 @@ ENV PYTHONDONTWRITEBYTECODE=1 \
|
|||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY requirements.txt /app/requirements.txt
|
COPY requirements.txt /app/requirements.txt
|
||||||
COPY requirements-dev.txt /app/requirements-dev.txt
|
COPY requirements-dev.txt /app/requirements-dev.txt
|
||||||
RUN pip install --no-cache-dir -r /app/requirements.txt -r /app/requirements-dev.txt
|
RUN pip install --no-cache-dir -r /app/requirements.txt -r /app/requirements-dev.txt && \
|
||||||
|
addgroup --system atlasbot && \
|
||||||
|
adduser --system --ingroup atlasbot --home /app atlasbot && \
|
||||||
|
chown -R atlasbot:atlasbot /app
|
||||||
|
|
||||||
|
USER atlasbot
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user