Krish Shah-Nathwani commited on
Commit
a4e34a1
·
1 Parent(s): a43adb2

added entrypoint.sh and reflected that in Dockerfile

Browse files
Files changed (2) hide show
  1. Dockerfile +16 -5
  2. entrypoint.sh +8 -0
Dockerfile CHANGED
@@ -1,17 +1,28 @@
1
  FROM python:3.10-slim
2
 
3
- # Set working directory
4
  WORKDIR /app
5
 
6
- # Copy dependency list and install python packages
 
 
 
 
 
7
  COPY requirements.txt .
8
  RUN pip install --no-cache-dir -r requirements.txt
9
 
10
- # Copy files into the container
11
  COPY . .
12
 
 
 
 
 
 
 
13
  # Expose container-side ports:
14
  EXPOSE 7860 8000 9100
15
 
16
- # Launch app
17
- CMD ["python", "app.py"]
 
 
1
  FROM python:3.10-slim
2
 
 
3
  WORKDIR /app
4
 
5
+ # System deps (node exporter)
6
+ RUN apt-get update \
7
+ && apt-get install -y --no-install-recommends prometheus-node-exporter ca-certificates \
8
+ && rm -rf /var/lib/apt/lists/*
9
+
10
+ # Python deps
11
  COPY requirements.txt .
12
  RUN pip install --no-cache-dir -r requirements.txt
13
 
14
+ # App files
15
  COPY . .
16
 
17
+ # Ensure entrypoint is executable
18
+ RUN chmod +x /app/entrypoint.sh
19
+
20
+ # Env for Gradio inside containers
21
+ ENV GRADIO_SERVER_NAME=0.0.0.0
22
+
23
  # Expose container-side ports:
24
  EXPOSE 7860 8000 9100
25
 
26
+ # Start both Node Exporter and the app
27
+ ENTRYPOINT ["/app/entrypoint.sh"]
28
+
entrypoint.sh ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ #!/bin/sh
2
+ set -e
3
+
4
+ prometheus-node-exporter &
5
+
6
+ sleep 0.3
7
+
8
+ exec python app.py