Subham9126 commited on
Commit
208e7c2
·
verified ·
1 Parent(s): feda836

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +15 -0
Dockerfile ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.9 # Or node:18 if you use JS
2
+
3
+ # 1. Install Lightpanda binary
4
+ RUN curl -L -o /usr/local/bin/lightpanda https://github.com/lightpanda-io/browser/releases/download/nightly/lightpanda-x86_64-linux \
5
+ && chmod +x /usr/local/bin/lightpanda
6
+
7
+ # 2. Setup your automation app (e.g., a FastAPI server to trigger tasks)
8
+ WORKDIR /app
9
+ COPY . .
10
+ RUN pip install playwright fastapi uvicorn
11
+
12
+ # 3. Start Lightpanda in the background and then your app
13
+ # HF Spaces requires your app to listen on port 7860
14
+ CMD lightpanda serve --host 127.0.0.1 --port 9222 & \
15
+ uvicorn main:app --host 0.0.0.0 --port 7860