DocsGPT/application/Dockerfile

32 lines
958 B
Docker
Raw Normal View History

2023-12-22 13:25:57 +00:00
FROM python:3.11-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 apt-get install -y wget unzip
RUN wget https://d3dg1063dc54p9.cloudfront.net/models/embeddings/mpnet-base-v2.zip
RUN unzip mpnet-base-v2.zip -d model
RUN rm mpnet-base-v2.zip
2023-02-23 14:08:34 +00:00
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y && apt-get install --reinstall libc6-dev -y
ENV PATH="/root/.cargo/bin:${PATH}"
2023-12-22 13:25:57 +00:00
RUN pip install --upgrade pip && pip install tiktoken==0.5.2
2023-03-06 18:34:48 +00:00
COPY requirements.txt .
RUN pip install -r requirements.txt
2023-03-06 18:34:48 +00:00
2023-12-22 13:25:57 +00:00
FROM python:3.11-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 --from=builder /model /app/model
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"]