File size: 853 Bytes
69bdc88
 
 
3ebddc9
19cdaa2
75d5bb2
3ebddc9
 
 
 
 
 
7a35fe9
 
3ebddc9
75d5bb2
3ebddc9
75d5bb2
 
3ebddc9
7a35fe9
3ebddc9
7a35fe9
3ebddc9
 
75d5bb2
3ebddc9
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# Use an official Python runtime as the base image
FROM python:3.9-slim

# Set the working directory inside the container
WORKDIR /opt/app

# Copy and install Python dependencies
COPY requirements.txt . 
RUN python -m pip install --upgrade pip && \
    pip install --no-cache-dir -r requirements.txt

# Install system dependencies and Prometheus Node Exporter
RUN apt-get update && \
    apt-get upgrade -yq ca-certificates && \
    apt-get install -yq --no-install-recommends prometheus-node-exporter

# Copy the rest of the application files
COPY . .

# Set environment variables
ENV GRADIO_SERVER_NAME="0.0.0.0"
ENV DEBIAN_FRONTEND=noninteractive

# Expose application ports
EXPOSE 7860 8000 9100

# Start Prometheus Node Exporter and the application
CMD ["bash", "-c", "prometheus-node-exporter --web.listen-address=:9100 & python /opt/app/app.py"]