update
This commit is contained in:
4
.gitignore
vendored
4
.gitignore
vendored
@@ -9,3 +9,7 @@ node_modules
|
|||||||
|
|
||||||
# local storage
|
# local storage
|
||||||
storage/
|
storage/
|
||||||
|
|
||||||
|
__pycache__/
|
||||||
|
|
||||||
|
config/
|
||||||
50
Dockerfile
50
Dockerfile
@@ -1,33 +1,51 @@
|
|||||||
# Build the frontend
|
# Build the frontend
|
||||||
FROM node:20-bookworm-slim AS build-frontend
|
FROM node:20-alpine AS build-frontend
|
||||||
|
|
||||||
WORKDIR /src
|
WORKDIR /src
|
||||||
|
|
||||||
# Copy required source files
|
# Copy required source files
|
||||||
COPY *.json .
|
COPY --chown=node:node *.json .
|
||||||
COPY *.js .
|
COPY --chown=node:node *.js .
|
||||||
COPY src/frontend ./src/frontend
|
COPY --chown=node:node src/frontend ./src/frontend
|
||||||
|
|
||||||
# Install NodeJS deps, exluding electron
|
# Fix permissions and install NodeJS deps
|
||||||
|
USER root
|
||||||
|
RUN chown -R node:node /src
|
||||||
|
USER node
|
||||||
RUN npm install --omit=dev && \
|
RUN npm install --omit=dev && \
|
||||||
npm run build-frontend
|
npm run build-frontend
|
||||||
|
|
||||||
# Main app build
|
# Main app build
|
||||||
FROM python:3.11-bookworm
|
FROM python:3.11-alpine
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# Install Python deps
|
# Install system dependencies
|
||||||
COPY ./requirements.txt .
|
RUN apk add --no-cache \
|
||||||
RUN pip install -r requirements.txt
|
gcc \
|
||||||
|
musl-dev \
|
||||||
|
python3-dev \
|
||||||
|
libffi-dev \
|
||||||
|
openssl-dev
|
||||||
|
|
||||||
# Copy prebuilt frontend
|
# Create config directories with proper permissions
|
||||||
COPY --from=build-frontend /src/public public
|
RUN mkdir -p /config/.reticulum /config/.meshchat && \
|
||||||
|
chown -R 1000:1000 /config
|
||||||
|
|
||||||
|
# Install Python deps
|
||||||
|
COPY --chown=1000:1000 ./requirements.txt .
|
||||||
|
RUN pip install --no-cache-dir -r requirements.txt
|
||||||
|
|
||||||
|
# Create public directory and copy frontend
|
||||||
|
RUN mkdir -p /app/public
|
||||||
|
COPY --from=build-frontend --chown=1000:1000 /src/public/ /app/public/
|
||||||
|
|
||||||
# Copy other required source files
|
# Copy other required source files
|
||||||
COPY *.py .
|
COPY --chown=1000:1000 *.py .
|
||||||
COPY src/__init__.py ./src/__init__.py
|
COPY --chown=1000:1000 src/__init__.py ./src/__init__.py
|
||||||
COPY src/backend ./src/backend
|
COPY --chown=1000:1000 src/backend ./src/backend
|
||||||
COPY *.json .
|
COPY --chown=1000:1000 *.json .
|
||||||
|
|
||||||
CMD ["python", "meshchat.py", "--host=0.0.0.0", "--reticulum-config-dir=/config/.reticulum", "--storage-dir=/config/.meshchat", "--headless"]
|
USER 1000
|
||||||
|
ENTRYPOINT ["python"]
|
||||||
|
CMD ["meshchat.py", "--host=0.0.0.0", "--reticulum-config-dir=/config/.reticulum", "--storage-dir=/config/.meshchat", "--headless"]
|
||||||
|
|||||||
@@ -1,3 +1,12 @@
|
|||||||
|
# Ivans Fork Edition
|
||||||
|
|
||||||
|
- Rootless Docker Container
|
||||||
|
- Resource Limits
|
||||||
|
- Drop unnecassary permissions in container
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<p align="center">
|
<p align="center">
|
||||||
<a href="https://github.com/liamcottle/reticulum-meshchat"><img src="./logo/logo-chat-bubble.png" width="150"></a>
|
<a href="https://github.com/liamcottle/reticulum-meshchat"><img src="./logo/logo-chat-bubble.png" width="150"></a>
|
||||||
</p>
|
</p>
|
||||||
|
|||||||
40
docker-compose.dev.yml
Normal file
40
docker-compose.dev.yml
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
services:
|
||||||
|
reticulum-meshchat:
|
||||||
|
container_name: reticulum-meshchat-dev
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
|
dockerfile: Dockerfile
|
||||||
|
pull_policy: never
|
||||||
|
restart: unless-stopped
|
||||||
|
user: "1000:1000"
|
||||||
|
# Make the meshchat web interface accessible from the host on port 8000
|
||||||
|
ports:
|
||||||
|
- 0.0.0.0:8000:8000
|
||||||
|
volumes:
|
||||||
|
- meshchat-config:/config:rw
|
||||||
|
- .:/app:delegated
|
||||||
|
- /app/public
|
||||||
|
# Uncomment if you have a USB device connected, such as an RNode
|
||||||
|
# devices:
|
||||||
|
# - /dev/ttyUSB0:/dev/ttyUSB0
|
||||||
|
cap_drop:
|
||||||
|
- ALL
|
||||||
|
cap_add:
|
||||||
|
- NET_ADMIN
|
||||||
|
- NET_RAW
|
||||||
|
deploy:
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
cpus: '1'
|
||||||
|
memory: 512M
|
||||||
|
reservations:
|
||||||
|
cpus: '0.25'
|
||||||
|
memory: 128M
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
meshchat-config:
|
||||||
|
driver: local
|
||||||
|
driver_opts:
|
||||||
|
type: none
|
||||||
|
o: bind
|
||||||
|
device: ${PWD}/config
|
||||||
@@ -4,14 +4,28 @@ services:
|
|||||||
image: ghcr.io/liamcottle/reticulum-meshchat:latest
|
image: ghcr.io/liamcottle/reticulum-meshchat:latest
|
||||||
pull_policy: always
|
pull_policy: always
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
user: "1000:1000"
|
||||||
# Make the meshchat web interface accessible from the host on port 8000
|
# Make the meshchat web interface accessible from the host on port 8000
|
||||||
ports:
|
ports:
|
||||||
- 0.0.0.0:8000:8000
|
- 0.0.0.0:8000:8000
|
||||||
volumes:
|
volumes:
|
||||||
- meshchat-config:/config
|
- meshchat-config:/config:rw
|
||||||
# Uncomment if you have a USB device connected, such as an RNode
|
# Uncomment if you have a USB device connected, such as an RNode
|
||||||
# devices:
|
# devices:
|
||||||
# - /dev/ttyUSB0:/dev/ttyUSB0
|
# - /dev/ttyUSB0:/dev/ttyUSB0
|
||||||
|
cap_drop:
|
||||||
|
- ALL
|
||||||
|
cap_add:
|
||||||
|
- NET_ADMIN
|
||||||
|
- NET_RAW
|
||||||
|
deploy:
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
cpus: '1'
|
||||||
|
memory: 512M
|
||||||
|
reservations:
|
||||||
|
cpus: '0.25'
|
||||||
|
memory: 128M
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
meshchat-config:
|
meshchat-config:
|
||||||
|
|||||||
Reference in New Issue
Block a user