2025-01-02 19:39:26 -06:00
|
|
|
# From original Dockerfile at https://github.com/TheCommsChannel/TC2-BBS-mesh
|
|
|
|
FROM debian:stable-slim AS build
|
2024-06-27 19:25:35 +02:00
|
|
|
|
2025-01-02 19:39:26 -06:00
|
|
|
RUN apt-get update && \
|
|
|
|
apt-get install -y \
|
|
|
|
git \
|
|
|
|
&& apt-get clean && rm -rf /var/lib/apt/lists/*
|
2024-06-27 19:25:35 +02:00
|
|
|
|
|
|
|
# Clone the repository
|
|
|
|
RUN git clone https://github.com/TheCommsChannel/TC2-BBS-mesh.git
|
|
|
|
|
2025-01-02 19:39:26 -06:00
|
|
|
####
|
2024-06-27 19:25:35 +02:00
|
|
|
|
2025-01-02 19:39:26 -06:00
|
|
|
FROM --platform=$BUILDPLATFORM python:alpine
|
2024-06-27 19:25:35 +02:00
|
|
|
|
2025-01-02 19:39:26 -06:00
|
|
|
# Switch to non-root user
|
|
|
|
RUN adduser --disabled-password mesh
|
|
|
|
USER mesh
|
|
|
|
RUN mkdir -p /home/mesh/bbs
|
|
|
|
WORKDIR /home/mesh/bbs
|
2024-06-27 19:25:35 +02:00
|
|
|
|
2025-01-02 19:39:26 -06:00
|
|
|
# Install Python dependencies
|
|
|
|
COPY --from=build /TC2-BBS-mesh/requirements.txt ./
|
|
|
|
RUN pip install --no-cache-dir --break-system-packages -r requirements.txt
|
2024-06-27 19:25:35 +02:00
|
|
|
|
2025-01-02 19:39:26 -06:00
|
|
|
# Copy over app code
|
|
|
|
COPY --from=build /TC2-BBS-mesh/*.py ./
|
|
|
|
|
|
|
|
# Define config volume
|
|
|
|
VOLUME /home/mesh/bbs/config
|
|
|
|
WORKDIR /home/mesh/bbs/config
|
|
|
|
COPY --from=build /TC2-BBS-mesh/example_config.ini ./config.ini
|
|
|
|
COPY --from=build /TC2-BBS-mesh/fortunes.txt ./
|
2024-06-27 19:25:35 +02:00
|
|
|
|
|
|
|
# Define the command to run
|
2025-01-02 19:39:26 -06:00
|
|
|
ENTRYPOINT [ "python3", "/home/mesh/bbs/server.py" ]
|