sreyakumar commited on
Commit ·
9f73c72
1
Parent(s): 938e7dc
Edited docker file for HF space compatibility
Browse files- 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 |
-
#
|
| 7 |
-
|
| 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 |
-
#
|
| 21 |
-
|
| 22 |
|
| 23 |
-
#
|
| 24 |
-
|
| 25 |
|
| 26 |
-
#
|
| 27 |
-
EXPOSE
|
| 28 |
|
| 29 |
-
# Run
|
| 30 |
-
CMD ["chainlit", "run", "app.py", "--host", "0.0.0.0", "--port", "
|
| 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 |
|