forked from MeshAddicts/meshinfo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
26 lines (18 loc) · 837 Bytes
/
Dockerfile
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
FROM python:3.12-slim
LABEL org.opencontainers.image.source https://github.com/MeshAddicts/meshinfo
LABEL org.opencontainers.image.description "Realtime web UI to run against a Meshtastic regional or private mesh network."
ENV MQTT_TLS=false
ENV PYTHONUNBUFFERED=1
# Set the working directory in the container
RUN mkdir /app
WORKDIR /app
# Copy the requirements file
COPY requirements.txt .
# Install Python dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Add a HEALTHCHECK instruction
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 CMD python -c "import socket; s = socket.socket(socket.AF_INET, socket.SOCK_STREAM); result = s.connect_ex(('localhost', 8000)); s.close(); exit(result)"
# Copy the project code
COPY . .
# Set the command to run the application
CMD ["python", "main.py"]