DocsGPT/application/Dockerfile

24 lines
738 B
Docker
Raw Normal View History

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-25 19:20:09 +00:00
FROM python:3.10-slim-bullseye
2023-06-15 16:40:58 +00:00
# Copy pre-built packages and binaries from builder stage
COPY --from=builder /usr/local/ /usr/local/
2023-02-03 12:45:29 +00:00
WORKDIR /app
COPY . /app/application
2023-02-03 12:45:29 +00:00
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
EXPOSE 7091
2023-02-03 12:45:29 +00:00
CMD ["gunicorn", "-w", "2", "--timeout", "120", "--bind", "0.0.0.0:7091", "application.wsgi:app"]