Compare commits

..

1 commit

Author SHA1 Message Date
Ricardo Dantas 7f97c5e285
Merge 9ece3719c7 into 6d7e1f4ad2 2025-01-02 20:30:26 -05:00
2 changed files with 16 additions and 27 deletions

View file

@ -1,36 +1,25 @@
# From original Dockerfile at https://github.com/TheCommsChannel/TC2-BBS-mesh
FROM debian:stable-slim AS build
FROM alpine:latest
RUN apt-get update && \
apt-get install -y \
git \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
# Install required packages
RUN apk add --update --no-cache git python3 py3-pip
# Clone the repository
RUN git clone https://github.com/TheCommsChannel/TC2-BBS-mesh.git
####
FROM --platform=$BUILDPLATFORM python:alpine
# Switch to non-root user
RUN adduser --disabled-password mesh
USER mesh
RUN mkdir -p /home/mesh/bbs
WORKDIR /home/mesh/bbs
# Install Python dependencies
COPY --from=build /TC2-BBS-mesh/requirements.txt ./
RUN pip install --no-cache-dir --break-system-packages -r requirements.txt
RUN pip install --no-cache-dir --break-system-packages -r /TC2-BBS-mesh/requirements.txt
# Copy over app code
COPY --from=build /TC2-BBS-mesh/*.py ./
# Copy configuration script
COPY configini.sh /
# Set permissions for configuration script
RUN chmod +x /configini.sh
# 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 ./
VOLUME /config
# Define working directory
WORKDIR /config
# Define the command to run
ENTRYPOINT [ "python3", "/home/mesh/bbs/server.py" ]
CMD ["sh", "-c", " /configini.sh && python3 /TC2-BBS-mesh/server.py"]

View file

@ -3,5 +3,5 @@ services:
build: .
restart: always
volumes:
- ./config:/home/mesh/bbs/config
- ./config:/config
container_name: tc2-bbs-mesh