trioskosmos commited on
Commit
23592d5
·
verified ·
1 Parent(s): 1f2a575

Upload Dockerfile with huggingface_hub

Browse files
Files changed (1) hide show
  1. 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 so maturin can see engine_rust_src/Cargo.toml
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 (required for some HF Space environments)
37
- RUN useradd -m -u 1000 user
38
- USER user
39
  ENV HOME=/home/user \
40
  PATH=/home/user/.local/bin:$PATH
41
 
42
- # Expose the port used by Hugging Face Spaces
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"]