TC2-BBS-mesh/docker/Dockerfile

37 lines
981 B
Docker
Raw Normal View History

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