2023-03-01 15:37:12 +00:00
|
|
|
FROM python:3.10 as builder
|
2022-03-27 19:58:54 +00:00
|
|
|
|
2023-03-01 15:37:12 +00:00
|
|
|
ENV PYTHONDONTWRITEBYTECODE=1 \
|
2023-02-26 21:00:09 +00:00
|
|
|
PYTHONUNBUFFERED=1 \
|
|
|
|
PIP_NO_CACHE_DIR=true
|
2022-03-27 19:58:54 +00:00
|
|
|
|
2023-03-01 15:37:12 +00:00
|
|
|
COPY requirements.txt ./
|
|
|
|
|
|
|
|
RUN python -m venv /opt/venv && \
|
|
|
|
/opt/venv/bin/pip install --upgrade pip setuptools wheel && \
|
|
|
|
/opt/venv/bin/pip install --no-deps -r requirements.txt
|
|
|
|
|
|
|
|
FROM python:3.10-slim
|
2022-03-27 19:58:54 +00:00
|
|
|
|
2023-03-01 15:37:12 +00:00
|
|
|
COPY --from=builder /opt/venv /opt/venv
|
2023-02-22 16:53:59 +00:00
|
|
|
|
2023-03-01 15:37:12 +00:00
|
|
|
ENV TRANSFORMERS_CACHE=/cache \
|
|
|
|
PYTHONDONTWRITEBYTECODE=1 \
|
|
|
|
PYTHONUNBUFFERED=1 \
|
|
|
|
PATH="/opt/venv/bin:$PATH"
|
|
|
|
|
|
|
|
WORKDIR /usr/src/app
|
2022-03-27 19:58:54 +00:00
|
|
|
|
|
|
|
COPY . .
|
2023-02-23 15:54:04 +00:00
|
|
|
|
2023-03-01 15:37:12 +00:00
|
|
|
CMD ["gunicorn", "src.main:server"]
|