forked from MeshAddicts/meshinfo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
42 lines (28 loc) · 1.03 KB
/
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
FROM node:20.11.1 as frontend
COPY . .
WORKDIR /frontend
RUN corepack enable
RUN yarn
RUN yarn build --base=/next
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 .
# Update pip
RUN pip install --upgrade pip
# 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 . .
RUN chmod +x run.sh
COPY --from=frontend /frontend/dist /app/dist
# Set the command to run the application
CMD ["./run.sh"]