CoolFace
Apppublic

loklybykhan/lokly-gravity-algorithm-feed

sourceHugging Faceupdated 3mo agoView on Hugging Face
1likes
Dockerfile29 linesDownload Raw Back to root
1# Use an official lightweight Python image
2FROM python:3.12-slim
3
4# Set the working directory
5WORKDIR /code
6
7# Copy the requirements file into the container
8COPY ./requirements.txt /code/requirements.txt
9
10# Install the dependencies
11RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
12
13# Hugging Face requires running as a non-root user (UID 1000)
14RUN useradd -m -u 1000 user
15USER user
16ENV HOME=/home/user \
17    PATH=/home/user/.local/bin:$PATH
18
19# Set the working directory to the user's home directory
20WORKDIR $HOME/app
21
22# Copy the rest of the application code
23COPY --chown=user . $HOME/app
24
25# Expose port 7860 (Hugging Face Requirement)
26EXPOSE 7860
27
28# Run the Flask app
29CMD ["python", "feed_api.py"]