Archived
Добавлен non-root Dockerfile backend
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
FROM python:3.12-slim
|
||||
|
||||
ENV PYTHONDONTWRITEBYTECODE=1 \
|
||||
PYTHONUNBUFFERED=1
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY requirements.txt .
|
||||
RUN pip install --no-cache-dir -r requirements.txt \
|
||||
&& groupadd --system panel \
|
||||
&& useradd --system --gid panel --home-dir /app panel
|
||||
|
||||
COPY app ./app
|
||||
RUN chown -R panel:panel /app
|
||||
USER panel
|
||||
|
||||
EXPOSE 8000
|
||||
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]
|
||||
Reference in New Issue
Block a user