Skip to content

Commit a6e57d9

Browse files
authored
Update Dockerfile
1 parent f3349f5 commit a6e57d9

1 file changed

Lines changed: 13 additions & 10 deletions

File tree

Dockerfile

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,25 @@
11
FROM python:3.10-slim
2-
2+
# Can happen early, almost never changes
33
WORKDIR /opt/app
4-
COPY . .
5-
RUN pip install --no-cache-dir -r /opt/app/requirements.txt
64

7-
# Install packages that we need. vim is for helping with debugging
5+
# Install packages that we need.
6+
# Again does not change often
87
ENV DEBIAN_FRONTEND noninteractive
98
RUN apt-get update && \
109
apt-get upgrade -yq ca-certificates && \
1110
apt-get install -yq --no-install-recommends \
1211
prometheus-node-exporter
1312

14-
15-
EXPOSE 7860
16-
EXPOSE 8000
13+
# Some environment variables that don't change often
14+
EXPOSE 7860
15+
EXPOSE 8000
1716
EXPOSE 9100
18-
19-
2017
ENV GRADIO_SERVER_NAME="0.0.0.0"
2118

22-
CMD bash -c "prometheus-node-exporter --web.listen-address=':9100' & python /opt/app/app.py"
19+
# We put this near the end since it can change
20+
COPY requirements.txt requirements.txt
21+
RUN pip install --no-cache-dir -r /opt/app/requirements.txt
22+
23+
# This changes the most, so it goes last!
24+
COPY . .
25+
CMD bash -c "prometheus-node-exporter --web.listen-address=':9100' & python /opt/app/app.py"

0 commit comments

Comments
 (0)