cleanupX2

This commit is contained in:
SpudGunMan
2025-10-23 09:39:21 -07:00
parent f8a94fca71
commit d9febeef0f
4 changed files with 46 additions and 16 deletions

View File

@@ -1,21 +1,31 @@
FROM python:3.13-slim
ENV PYTHONUNBUFFERED=1
RUN apt-get update && apt-get install -y gettext tzdata locales nano && rm -rf /var/lib/apt/lists/*
ENV PYTHONUNBUFFERED=1 \
LANG=en_US.UTF-8 \
LANGUAGE=en_US:en \
LC_ALL=en_US.UTF-8 \
TZ=America/Los_Angeles
# Set the locale default to en_US.UTF-8
RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \
dpkg-reconfigure --frontend=noninteractive locales && \
update-locale LANG=en_US.UTF-8
ENV LANG="en_US.UTF-8"
ENV TZ="America/Los_Angeles"
RUN apt-get update && \
apt-get install -y gettext tzdata locales nano && \
sed -i 's/^# *\(en_US.UTF-8 UTF-8\)/\1/' /etc/locale.gen && \
locale-gen en_US.UTF-8 && \
rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Install dependencies first for better caching
COPY requirements.txt /app/
RUN pip install --no-cache-dir -r requirements.txt
# Copy the rest of the application
COPY . /app
COPY config.template /app/config.ini
RUN pip install -r requirements.txt
RUN chmod +x /app/script/docker/entrypoint.sh
# Add a non-root user and switch to it
RUN useradd -m appuser
USER appuser
ENTRYPOINT ["/bin/bash", "/app/script/docker/entrypoint.sh"]

View File

@@ -1,3 +1,6 @@
# Docker Compose configuration for Meshing Around.
# This setup includes the main Meshing Around service, with optional Ollama and Prometheus Node Exporter services.
# Adjust device mappings, ports, and configurations as needed for your environment.
services:
meshing-around:
stdin_open: true
@@ -5,10 +8,18 @@ services:
ports:
- 8420:8420
devices: # Optional if using meshtasticd. Pass through radio device.
- /dev/ttyUSB0
- /dev/ttyUSB0 # Replace this with your actual device!
#- /dev/ttyAMA0 # Example
volumes:
- /data/meshing-around/config.ini:/app/config.ini:rw
image: ghcr.io/SpudGunMan/meshing-around:test-all-changes
container_name: meshing-around
restart: unless-stopped
environment:
- OLLAMA_API_URL=http://ollama:11434
extra_hosts:
#- "host.docker.internal:host-gateway" # Enables access to host services from within the container.
user: "1000:1000" # run as non-root user for better security
meshtasticd: # Runs a virtual node. Optional, but can be used to link meshing-around directly to mqtt.
ports:
@@ -19,8 +30,14 @@ services:
ollama: # Used for enabling LLM interactions.
ports:
- 11434:11434
- 11434:11434 # Ollama API port
volumes:
- /data/ollama:/root/.ollama
container_name: ollama
image: alpine/ollama
image: ollama/ollama:latest
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:11434/api/tags"]
interval: 30s
timeout: 10s
retries: 5

View File

@@ -1,4 +1,4 @@
# Docker Compose configuration for Meshing Around application with optional services.
# OLD Docker Compose configuration for Meshing Around application with optional services.
# This setup includes the main Meshing Around service, with optional Ollama and Prometheus Node Exporter services.
# Adjust device mappings, ports, and configurations as needed for your environment.
@@ -14,6 +14,9 @@ services:
configs:
- source: me_config
target: /app/config.ini
devices: # Optional if using meshtasticd. Pass through radio device.
- /dev/ttyAMA10 # Replace this with your actual device!
#- /dev/ttyUSB0 # Example for USB device
user: 1000:1000 # run as non-root user for better security.
extra_hosts:
# - "host.docker.internal:host-gateway" # Enables access to host services from within the container.

View File

@@ -8,8 +8,8 @@ pid=$!
# Pause for Ollama to start.
sleep 5
echo "🔴 Retrieve llama3.2:3b model..."
ollama pull llama3.2:3b
echo "🔴 Retrieve gemma3:270m model..."
ollama pull gemma3:270m
echo "🟢 Done!"
# Wait for Ollama process to finish.