Skip to content

Commit 7489fa2

Browse files
Add files via upload
1 parent 2f970bc commit 7489fa2

2 files changed

Lines changed: 63 additions & 0 deletions

File tree

Dockerfile

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Use official Python runtime as a parent image
2+
FROM python:3.10-slim
3+
4+
# Set environment variables
5+
ENV PYTHONDONTWRITEBYTECODE=1
6+
ENV PYTHONUNBUFFERED=1
7+
ENV TERM=xterm-256color
8+
9+
# Set working directory
10+
WORKDIR /app
11+
12+
# Install system dependencies (needed for psutil and network tools)
13+
RUN apt-get update && apt-get install -y --no-install-recommends \
14+
gcc \
15+
python3-dev \
16+
iproute2 \
17+
&& rm -rf /var/lib/apt/lists/*
18+
19+
# Copy requirements first to leverage Docker cache
20+
COPY requirements.txt .
21+
22+
# Install Python dependencies
23+
RUN pip install --no-cache-dir -r requirements.txt
24+
25+
# Copy the rest of the application
26+
COPY . .
27+
28+
# Expose ports
29+
# 37020/udp: Peer discovery broadcast
30+
# 5000/tcp: File transfer
31+
EXPOSE 37020/udp
32+
EXPOSE 5000/tcp
33+
34+
# Run the application
35+
ENTRYPOINT ["python", "-m", "mesh_pulse"]

docker-compose.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
version: '3.8'
2+
3+
services:
4+
mesh-pulse:
5+
build: .
6+
image: mesh-pulse:latest
7+
container_name: mesh-pulse
8+
# Host networking is recommended for UDP broadcast discovery to work effectively on Linux.
9+
# On Windows/Mac Docker Desktop, host networking has limitations; port mapping is used as fallback.
10+
# network_mode: "host"
11+
12+
ports:
13+
- "37020:37020/udp" # Broadcast Discovery
14+
- "5000:5000" # File Transfer
15+
16+
volumes:
17+
- ./received_files:/app/received_files
18+
- ./panel_output.txt:/app/panel_output.txt
19+
20+
environment:
21+
- MESH_PULSE_KEY=my-secret-mesh-key
22+
- PYTHONUNBUFFERED=1
23+
24+
# Enable TTY for Textual TUI
25+
tty: true
26+
stdin_open: true
27+
28+
restart: unless-stopped

0 commit comments

Comments
 (0)