TC2-BBS-mesh/docker/Dockerfile

38 lines
899 B
Docker
Raw Normal View History

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