MaheshP98 commited on
Commit
d1baf0f
·
verified ·
1 Parent(s): cfdd494

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +33 -0
Dockerfile ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ```
2
+ FROM python:3.10-slim
3
+
4
+ # Install system dependencies for WeasyPrint
5
+ RUN apt-get update && apt-get install -y \
6
+ git git-lfs curl libpango-1.0-0 libpangoft2-1.0-0 && \
7
+ rm -rf /var/lib/apt/lists/*
8
+
9
+ # Install Node.js for Streamlit
10
+ RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \
11
+ apt-get install -y nodejs && \
12
+ rm -rf /var/lib/apt/lists/*
13
+
14
+ # Create user
15
+ RUN useradd -m -u 1000 user
16
+
17
+ # Set working directory
18
+ WORKDIR /home/user/app
19
+ USER user
20
+
21
+ # Copy and install requirements
22
+ COPY --chown=user:user requirements.txt .
23
+ RUN pip install --no-cache-dir -r requirements.txt
24
+
25
+ # Copy application files
26
+ COPY --chown=user:user . .
27
+
28
+ # Expose port
29
+ EXPOSE 7860
30
+
31
+ # Run Streamlit
32
+ CMD ["streamlit", "run", "app.py", "--server.port", "7860", "--server.address", "0.0.0.0"]
33
+ ```