larrysim commited on
Commit
bb4d9f2
·
verified ·
1 Parent(s): e0916e6

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +30 -0
Dockerfile ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use an official Python runtime as a base image
2
+ FROM python:3.9-slim
3
+
4
+ # Set working directory in the container
5
+ WORKDIR /app
6
+
7
+ # Install system dependencies required for TensorFlow and other packages
8
+ RUN apt-get update && apt-get install -y \
9
+ gcc \
10
+ g++ \
11
+ make \
12
+ && rm -rf /var/lib/apt/lists/*
13
+
14
+ # Copy requirements file first to leverage Docker cache
15
+ COPY requirements.txt .
16
+
17
+ # Install Python dependencies
18
+ RUN pip install --no-cache-dir -r requirements.txt
19
+
20
+ # Copy the rest of the application files
21
+ COPY . .
22
+
23
+ # Expose the port Streamlit will run on
24
+ EXPOSE 8501
25
+
26
+ # Health check to ensure the application is running
27
+ HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health || exit 1
28
+
29
+ # Command to run the application
30
+ CMD ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0"]