Spaces:
Runtime error
Runtime error
File size: 966 Bytes
e4f9cbe 29c64ea e4f9cbe bb6ad73 29c64ea 55dc3dd 29c64ea cd97409 29c64ea 8796ec1 e4f9cbe 55dc3dd e4f9cbe |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# NOTE: When we upgrade to 3.11 we can use a slimmer docker image which comes with gcc.
FROM python:3.9-bullseye
# Allow statements and log messages to immediately appear in the Knative logs
ENV PYTHONUNBUFFERED True
# Set the working directory in the container.
WORKDIR /server
# Install the dependencies. This requires exporting requirements.txt from poetry first, which
# happens from ./build_docker.sh.
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy the data to /data, the HF persistent storage. We do this after pip install to avoid
# re-installing dependencies if the data changes, which is likely more often.
WORKDIR /
COPY /data /data
WORKDIR /server
COPY .env .
COPY LICENSE .
# Copy static files.
COPY /web/blueprint/build ./web/blueprint/build
# Copy python files.
COPY /src ./src/
# Copy the entrypoint file.
COPY docker_entrypoint.sh .
CMD ["uvicorn", "src.server:app", "--host", "0.0.0.0", "--port", "5432"]
|