Complete lab 7 security implementation
This commit is contained in:
Executable
+28
@@ -0,0 +1,28 @@
|
||||
FROM python:3.12-slim
|
||||
|
||||
ENV PYTHONDONTWRITEBYTECODE=1 \
|
||||
PYTHONUNBUFFERED=1 \
|
||||
PIP_NO_CACHE_DIR=1
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Закрываем fixed-CVE в базовом Debian (apt, libpcre2, zlib и т.д.)
|
||||
RUN apt-get update \
|
||||
&& apt-get upgrade -y \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
COPY requirements.txt ./
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
||||
|
||||
COPY src ./src
|
||||
COPY scripts ./scripts
|
||||
COPY migrations ./migrations
|
||||
COPY alembic.ini ./
|
||||
|
||||
RUN useradd --create-home --shell /usr/sbin/nologin appuser \
|
||||
&& chown -R appuser:appuser /app
|
||||
USER appuser
|
||||
|
||||
EXPOSE 8080
|
||||
|
||||
CMD ["python", "-m", "src.main"]
|
||||
Reference in New Issue
Block a user