Files
syncio/Dockerfile
brusnitsyn 3fb2053705 v2026.06.3
2026-06-14 22:51:46 +09:00

50 lines
980 B
Docker
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

FROM python:3.12-alpine AS builder
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
PIP_NO_CACHE_DIR=1
WORKDIR /app
RUN apk add --no-cache \
build-base \
freetds \
freetds-dev \
linux-headers \
postgresql-dev
COPY req.txt .
RUN pip install --upgrade pip \
&& pip wheel --wheel-dir /wheels -r req.txt
FROM python:3.12-alpine AS runtime
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
PIP_NO_CACHE_DIR=1
WORKDIR /app
RUN apk add --no-cache \
freetds \
libpq \
tzdata
COPY req.txt .
COPY --from=builder /wheels /wheels
RUN pip install --upgrade pip \
&& pip install --no-index --find-links=/wheels -r req.txt \
&& rm -rf /wheels
COPY app ./app
COPY main.py .
# Фикс OpenSSL 3 совместимости с SQL Server 2016
COPY docker/openssl.cnf /etc/ssl/openssl.cnf
RUN mkdir -p logs
EXPOSE 8000
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]