Spaces:
Running
Running
Upload Dockerfile with huggingface_hub
Browse files- Dockerfile +11 -7
Dockerfile
CHANGED
|
@@ -22,26 +22,30 @@ ENV PATH="/root/.cargo/bin:${PATH}"
|
|
| 22 |
# Set the working directory
|
| 23 |
WORKDIR /app
|
| 24 |
|
| 25 |
-
# Copy the entire application early
|
| 26 |
COPY . .
|
| 27 |
|
|
|
|
|
|
|
|
|
|
| 28 |
# Install Python dependencies and build the Rust engine
|
| 29 |
-
# Using uv for faster builds
|
| 30 |
RUN pip install --no-cache-dir uv && \
|
| 31 |
uv pip install --system --no-cache .
|
| 32 |
|
|
|
|
|
|
|
|
|
|
| 33 |
# Compile card data
|
| 34 |
RUN python -m compiler.main
|
| 35 |
|
| 36 |
-
# Create a non-privileged user
|
| 37 |
-
RUN useradd -m -u 1000
|
| 38 |
-
USER
|
| 39 |
ENV HOME=/home/user \
|
| 40 |
PATH=/home/user/.local/bin:$PATH
|
| 41 |
|
| 42 |
-
# Expose the port
|
| 43 |
EXPOSE 7860
|
| 44 |
|
| 45 |
# Run the server
|
| 46 |
-
# HF Spaces expects the app to listen on 0.0.0.0:7860
|
| 47 |
CMD ["python", "backend/server.py"]
|
|
|
|
| 22 |
# Set the working directory
|
| 23 |
WORKDIR /app
|
| 24 |
|
| 25 |
+
# Copy the entire application early
|
| 26 |
COPY . .
|
| 27 |
|
| 28 |
+
# Ensure the user owns the app directory
|
| 29 |
+
RUN chown -R 1000:1000 /app
|
| 30 |
+
|
| 31 |
# Install Python dependencies and build the Rust engine
|
|
|
|
| 32 |
RUN pip install --no-cache-dir uv && \
|
| 33 |
uv pip install --system --no-cache .
|
| 34 |
|
| 35 |
+
# Diagnostic: Verify files are present
|
| 36 |
+
RUN ls -la /app && ls -la /app/ai || echo "AI DIR MISSING"
|
| 37 |
+
|
| 38 |
# Compile card data
|
| 39 |
RUN python -m compiler.main
|
| 40 |
|
| 41 |
+
# Create a non-privileged user
|
| 42 |
+
RUN useradd -m -u 1000 user_tmp || true
|
| 43 |
+
USER 1000
|
| 44 |
ENV HOME=/home/user \
|
| 45 |
PATH=/home/user/.local/bin:$PATH
|
| 46 |
|
| 47 |
+
# Expose the port
|
| 48 |
EXPOSE 7860
|
| 49 |
|
| 50 |
# Run the server
|
|
|
|
| 51 |
CMD ["python", "backend/server.py"]
|