Spaces:
Sleeping
Sleeping
File size: 891 Bytes
1eaa426 164f0b1 1eaa426 20b2cf3 1eaa426 5d9bc9a 1eaa426 |
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 |
# Use an official Python runtime as a parent image
FROM python:3.9-slim
# Set the working directory in the container
WORKDIR /code
# Copy the requirements file into the container at /code
COPY ./requirements.txt /code/requirements.txt
COPY ./vocab.txt /code/vocab.txt
# Install any needed packages specified in requirements.txt
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
# Copy the app and static directories into the container at /code
COPY ./app /code/app
COPY ./static /code/static
# Expose the port the app runs on. Hugging Face Spaces uses 7860 by default.
EXPOSE 7860
# Run uvicorn server.
# "app.main:app" -> find the `app` object in the `main.py` file inside the `app` folder.
# --host 0.0.0.0 makes it accessible from outside the container.
# --port 7860 to match the exposed port.
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"] |