Spaces:
Runtime error
Runtime error
Download Dockerfile from WebashalarForML/ImageDataExtractor2: direct link, hf CLI and curl.
- Browser
- Download file 1.08 kB
-
https://huggingface.co/spaces/WebashalarForML/ImageDataExtractor2/resolve/b3d0b203458ff9da65e76579f77f07ffcffd89b2/Dockerfile
- Command line
-
hf download hf://spaces/WebashalarForML/ImageDataExtractor2@b3d0b203458ff9da65e76579f77f07ffcffd89b2/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/WebashalarForML/ImageDataExtractor2/resolve/b3d0b203458ff9da65e76579f77f07ffcffd89b2/Dockerfile
1.08 kB
| # Use an official Python runtime as a parent image | |
| FROM python:3.9 | |
| # Install required system dependencies | |
| RUN apt-get update && apt-get install -y \ | |
| libgl1-mesa-glx \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Create a non-root user with a home directory | |
| RUN useradd -m -u 1000 user | |
| # Set the user to the non-root user | |
| USER user | |
| # Add the user's local bin to the PATH | |
| ENV PATH="/home/user/.local/bin:$PATH" | |
| # Set the working directory to /app | |
| WORKDIR /app | |
| # Copy the requirements.txt file and install any dependencies | |
| COPY --chown=user ./requirements.txt /app/requirements.txt | |
| RUN pip install --no-cache-dir --upgrade -r /app/requirements.txt | |
| # Copy the current directory contents into the container at /app | |
| COPY --chown=user . /app | |
| # Create the folders for uploads and results with appropriate permissions | |
| RUN mkdir -p /app/static/uploads /app/static/results && \ | |
| chmod -R 755 /app/static/uploads /app/static/results | |
| # Expose the port the app will run on | |
| EXPOSE 7860 | |
| # Run the Flask app using uvicorn | |
| CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"] | |