j49_c commited on
Commit
3ca025e
·
1 Parent(s): 1bc0412

Deploy to Hugging Face with Docker metadata

Browse files
Files changed (2) hide show
  1. Dockerfile +13 -12
  2. README.md +13 -0
Dockerfile CHANGED
@@ -1,25 +1,26 @@
1
- # Use an official Python runtime as a parent image
2
  FROM python:3.9-slim
3
 
4
- # Set the working directory in the container
5
- WORKDIR /app
6
-
7
- # Install system dependencies for psutil and others
8
  RUN apt-get update && apt-get install -y \
9
  gcc \
10
  python3-dev \
11
  && rm -rf /var/lib/apt/lists/*
12
 
13
- # Copy the current directory contents into the container at /app
14
- COPY . /app
 
 
 
 
 
 
 
 
15
 
16
- # Install any needed packages specified in requirements.txt
17
- RUN pip install --no-cache-dir -r requirements.txt
18
 
19
- # Run current project
20
- # Change port 30170 to 7860 as it is the default for Hugging Face
21
  ENV SERVER_PORT=7860
22
  EXPOSE 7860
23
 
24
- # Start the application
25
  CMD ["python", "app.py"]
 
 
1
  FROM python:3.9-slim
2
 
 
 
 
 
3
  RUN apt-get update && apt-get install -y \
4
  gcc \
5
  python3-dev \
6
  && rm -rf /var/lib/apt/lists/*
7
 
8
+ # Create a user for Hugging Face (UID 1000 is required)
9
+ RUN useradd -m -u 1000 user
10
+ USER user
11
+ ENV PATH="/home/user/.local/bin:$PATH"
12
+
13
+ WORKDIR /app
14
+
15
+ # Copy requirements first for better caching
16
+ COPY --chown=user requirements.txt .
17
+ RUN pip install --no-cache-dir --upgrade -r requirements.txt
18
 
19
+ # Copy all files with correct ownership
20
+ COPY --chown=user . .
21
 
22
+ # Hugging Face uses port 7860 by default
 
23
  ENV SERVER_PORT=7860
24
  EXPOSE 7860
25
 
 
26
  CMD ["python", "app.py"]
README.md CHANGED
@@ -1 +1,14 @@
 
 
 
 
 
 
 
 
 
1
  # hostbot
 
 
 
 
 
1
+ ---
2
+ title: hostbot
3
+ emoji: 🐳
4
+ colorFrom: blue
5
+ colorTo: black
6
+ sdk: docker
7
+ pinned: false
8
+ ---
9
+
10
  # hostbot
11
+ الذئب الابيض - @j49_c
12
+ Bot hosting system inspired by Apple x FPI collaboration.
13
+ 🐳 Deploy to Hugging Face Spaces using Docker.
14
+ ⚙️ Listening on port 7860.