sreyakumar commited on
Commit
9f73c72
·
1 Parent(s): 938e7dc

Edited docker file for HF space compatibility

Browse files
Files changed (1) hide show
  1. Dockerfile +16 -19
Dockerfile CHANGED
@@ -1,31 +1,28 @@
1
  FROM python:3.11-slim
2
 
 
 
 
 
 
3
  # Set working directory
4
  WORKDIR /app
5
 
6
- # Install system deps
7
- RUN apt-get update && apt-get install -y --no-install-recommends \
8
- build-essential \
9
- && rm -rf /var/lib/apt/lists/*
10
-
11
- # Copy pyproject.toml first (for dependency metadata)
12
- COPY pyproject.toml .
13
 
14
  # Install build requirements
15
- RUN pip install --upgrade pip setuptools wheel build
16
-
17
- # Copy the full source code
18
- COPY . .
19
 
20
- # Install your package + dependencies
21
- RUN pip install .
22
 
23
- # Move into Chainlit app folder
24
- WORKDIR /app/src/gamer_x/interface
25
 
26
- # Expose Chainlit’s default port
27
- EXPOSE 8000
28
 
29
- # Run your Chainlit app
30
- CMD ["chainlit", "run", "app.py", "--host", "0.0.0.0", "--port", "8000"]
31
 
 
1
  FROM python:3.11-slim
2
 
3
+ # Create a non-root user (required by Hugging Face Spaces)
4
+ RUN useradd -m -u 1000 user
5
+ USER user
6
+ ENV PATH="/home/user/.local/bin:$PATH"
7
+
8
  # Set working directory
9
  WORKDIR /app
10
 
11
+ # Copy dependency metadata first
12
+ COPY --chown=user pyproject.toml ./
 
 
 
 
 
13
 
14
  # Install build requirements
15
+ RUN pip install --no-cache-dir --upgrade pip setuptools wheel build
 
 
 
16
 
17
+ # Copy the rest of the code
18
+ COPY --chown=user . /app
19
 
20
+ # Install your package and deps
21
+ RUN pip install --no-cache-dir .
22
 
23
+ # Hugging Face Spaces expect apps to listen on port 7860
24
+ EXPOSE 7860
25
 
26
+ # Run Chainlit app (adjust path if needed)
27
+ CMD ["chainlit", "run", "src/gamer_x/interface/app.py", "--host", "0.0.0.0", "--port", "7860"]
28