acecalisto3 commited on
Commit
273bb6f
1 Parent(s): 79d819b

Update dockerfile.yml

Browse files
Files changed (1) hide show
  1. dockerfile.yml +15 -16
dockerfile.yml CHANGED
@@ -1,23 +1,22 @@
1
- # Base image
2
- FROM python:3.9-slim-buster
3
-
4
 
5
  WORKDIR /app
6
 
7
- COPY . .
8
- python -m pip install --upgrade pip
9
- RUN --mount=target=requirements.txt,source=requirements.txt pip install --no-cache-dir -r requirements.txt
10
- CMD ["python", "app.py"]
11
 
12
- # Copy package.json and install npm packages
13
- COPY package.json .
14
- RUN apt-get update && apt-get install -y npm && npm install
15
- python -m pip install --upgrade pip
16
- # Copy the rest of the files
17
  COPY . .
18
 
19
- # Expose the port
20
- EXPOSE 3003
 
 
 
21
 
22
- # Start the application
23
- CMD ["npm", "start"]
 
1
+ FROM python:3.9-slim
 
 
2
 
3
  WORKDIR /app
4
 
5
+ # Install git and other dependencies
6
+ RUN apt-get update && apt-get install -y git curl
 
 
7
 
8
+ # Copy requirements first to leverage Docker cache
9
+ COPY requirements.txt .
10
+ RUN pip install --no-cache-dir -r requirements.txt
11
+
12
+ # Copy the rest of the application
13
  COPY . .
14
 
15
+ # Expose the Streamlit port
16
+ EXPOSE 8501
17
+
18
+ # Health check to ensure the container is running properly
19
+ HEALTHCHECK --interval=30s --timeout=10s --start-period=30s --retries=3 CMD curl -f http://localhost:8501/_stcore/health || exit 1
20
 
21
+ # Command to run the application
22
+ ENTRYPOINT ["streamlit", "run", "app.py", "--server.address", "0.0.0.0"]