mirror of
https://github.com/SpudGunMan/meshing-around.git
synced 2026-03-28 17:32:36 +01:00
cleanupX2
This commit is contained in:
30
Dockerfile
30
Dockerfile
@@ -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"]
|
||||
|
||||
23
compose.yaml
23
compose.yaml
@@ -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
|
||||
@@ -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.
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user