Мессенджер с Postgres, Redis, Valkey

This commit is contained in:
Queenfish
2026-10-08 13:21:48 +03:00
parent 65003b6119
commit 6bfbcf74fc
41 changed files with 2624 additions and 24 deletions
+32
View File
@@ -0,0 +1,32 @@
FROM python:3.12-slim AS builder
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir --user -r requirements.txt
FROM python:3.12-slim
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
PATH=/home/appuser/.local/bin:$PATH
RUN useradd -m -u 1000 appuser
WORKDIR /app
COPY --from=builder /root/.local /home/appuser/.local
COPY ./app ./app
COPY ./migrations ./migrations
RUN chown -R appuser:appuser /app
USER appuser
EXPOSE 8080
CMD ["python", "-m", "uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8080"]