csaf-captcha / Dockerfile
aziac's picture
another try again
805ac97
raw
history blame
900 Bytes
# Use an official Python runtime as a parent image
FROM tensorflow/tensorflow:2.16.1-gpu
# Set the working directory in the container
WORKDIR /code
# Copy the requirements file into the container at /code
COPY ./requirements.txt /code/requirements.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
COPY ./model /code/model
# 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"]