-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdockerfile
More file actions
37 lines (28 loc) · 983 Bytes
/
dockerfile
File metadata and controls
37 lines (28 loc) · 983 Bytes
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
FROM python:3.13-bookworm
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
# Security updates
RUN apt-get update && \
apt-get upgrade -y && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# run the container as a non-root user
ARG UID=1000
ARG GID=1000
# Create a non-root user
RUN groupadd -g $GID meshtastic && \
useradd -u $UID -m -g meshtastic meshtastic
USER meshtastic
ENV PATH="/home/meshtastic/.local/bin:${PATH}"
WORKDIR /home/meshtastic
# Copy over project files
COPY --chown=meshtastic:meshtastic ./pyproject.toml ./alembic.ini ./
COPY --chown=meshtastic:meshtastic ./meshtastic_listener ./meshtastic_listener
RUN mkdir ./logs && chown -R meshtastic:meshtastic /home/meshtastic/logs
# install depdendencies
RUN pip3 install --user uv && uv sync
# make sure we're not running as root
HEALTHCHECK --interval=30s --timeout=3s \
CMD [ "$(id -u)" -ne 0 ] || exit 1
CMD uv run alembic upgrade head && \
uv run python -m meshtastic_listener