You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
DocsGPT/application/Dockerfile

24 lines
738 B
Docker

1 year ago
FROM python:3.10-slim-bullseye as builder
1 year ago
# 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}"
RUN pip install --upgrade pip && pip install tiktoken==0.3.3
1 year ago
COPY requirements.txt .
RUN pip install -r requirements.txt
1 year ago
FROM python:3.10-slim-bullseye
1 year ago
# Copy pre-built packages and binaries from builder stage
COPY --from=builder /usr/local/ /usr/local/
1 year ago
WORKDIR /app
COPY . /app/application
1 year ago
ENV FLASK_APP=app.py
1 year ago
ENV FLASK_DEBUG=true
EXPOSE 7091
1 year ago
CMD ["gunicorn", "-w", "2", "--timeout", "120", "--bind", "0.0.0.0:7091", "application.wsgi:app"]