Raymond Weitekamp commited on
Commit
14bfa78
·
1 Parent(s): 5c0089e

Add Dockerfile for Hugging Face Spaces

Browse files
Files changed (1) hide show
  1. Dockerfile +22 -0
Dockerfile ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.11-slim
2
+
3
+ WORKDIR /code
4
+
5
+ # Install build dependencies
6
+ RUN apt-get update && apt-get install -y \
7
+ build-essential \
8
+ && rm -rf /var/lib/apt/lists/*
9
+
10
+ # Copy only pyproject.toml first to leverage Docker cache
11
+ COPY pyproject.toml .
12
+
13
+ # Install project and dependencies
14
+ RUN pip install .
15
+
16
+ # Copy the rest of the application
17
+ COPY . .
18
+
19
+ # Expose port 7860 for Hugging Face Spaces
20
+ EXPOSE 7860
21
+
22
+ CMD ["python", "-c", "import cadviewer; from nicegui import app; app.native.start_args['port'] = 7860; cadviewer.ui.run(native=False, host='0.0.0.0', port=7860)"]