jebin2 commited on
Commit
02392c6
·
1 Parent(s): 943db10
Files changed (2) hide show
  1. Dockerfile +32 -0
  2. comic_panel_extractor/server.py +1 -1
Dockerfile ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use official Python image
2
+ FROM python:3.10-slim
3
+
4
+ # Install system dependencies
5
+ RUN apt-get update && apt-get install -y \
6
+ pkg-config \
7
+ && rm -rf /var/lib/apt/lists/*
8
+
9
+ # Create user (Hugging Face Spaces requirement)
10
+ RUN useradd -m -u 1000 user
11
+
12
+ # Switch to user early
13
+ USER user
14
+
15
+ # Set working directory
16
+ WORKDIR /home/user/app
17
+
18
+ # Set environment variables for Hugging Face Spaces
19
+ ENV HOME=/home/user \
20
+ PATH=/home/user/.local/bin:$PATH \
21
+ BASE_PATH=/home/user/app \
22
+ IS_DOCKER=True \
23
+ SERVER_PORT=7860
24
+
25
+ COPY --chown=user requirements.txt .
26
+ RUN pip install --no-cache-dir --user -r requirements.txt
27
+
28
+ # Copy app code
29
+ COPY --chown=user . .
30
+
31
+ # Entry point
32
+ CMD ["serve-comic-panel-extractor"]
comic_panel_extractor/server.py CHANGED
@@ -124,7 +124,7 @@ async def get_output_file(folder: str, filename: str):
124
 
125
  def main():
126
  import uvicorn
127
- uvicorn.run(app, host="0.0.0.0", port=8000)
128
 
129
  if __name__ == "__main__":
130
  main()
 
124
 
125
  def main():
126
  import uvicorn
127
+ uvicorn.run(app, host="0.0.0.0", port=7860)
128
 
129
  if __name__ == "__main__":
130
  main()