2023-02-25 19:20:09 +00:00
|
|
|
FROM python:3.10-slim-bullseye as builder
|
2023-02-03 12:45:29 +00:00
|
|
|
|
2023-02-23 14:08:34 +00:00
|
|
|
# Tiktoken requires Rust toolchain, so build it in a separate stage
|
|
|
|
RUN apt-get update && apt-get install -y gcc curl
|
|
|
|
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y && apt-get install --reinstall libc6-dev -y
|
|
|
|
ENV PATH="/root/.cargo/bin:${PATH}"
|
2023-03-31 09:45:40 +00:00
|
|
|
RUN pip install --upgrade pip && pip install tiktoken==0.3.3
|
2023-03-06 18:34:48 +00:00
|
|
|
COPY requirements.txt .
|
|
|
|
RUN pip install -r requirements.txt
|
|
|
|
|
2023-02-23 14:08:34 +00:00
|
|
|
|
2023-02-25 19:20:09 +00:00
|
|
|
FROM python:3.10-slim-bullseye
|
2023-02-23 14:08:34 +00:00
|
|
|
# Copy pre-built packages from builder stage
|
2023-02-25 19:20:09 +00:00
|
|
|
COPY --from=builder /usr/local/lib/python3.10/site-packages/ /usr/local/lib/python3.10/site-packages/
|
2023-03-14 14:29:36 +00:00
|
|
|
RUN pip install gunicorn==20.1.0
|
|
|
|
RUN pip install celery==5.2.7
|
2023-02-03 12:45:29 +00:00
|
|
|
WORKDIR /app
|
|
|
|
COPY . /app
|
|
|
|
ENV FLASK_APP=app.py
|
2023-02-25 19:20:09 +00:00
|
|
|
ENV FLASK_DEBUG=true
|
2023-03-14 14:29:36 +00:00
|
|
|
|
2023-02-03 12:45:29 +00:00
|
|
|
|
2023-02-28 11:59:37 +00:00
|
|
|
EXPOSE 5001
|
2023-02-03 12:45:29 +00:00
|
|
|
|
2023-03-06 19:28:22 +00:00
|
|
|
CMD ["gunicorn", "-w", "2", "--timeout", "120", "--bind", "0.0.0.0:5001", "wsgi:app"]
|