Merge pull request #7 from upchui/main

Add a Dockerfile for future Docker support Updated (fix fortunes.txt)
This commit is contained in:
TC² 2024-06-27 15:01:11 -04:00 committed by GitHub
commit 81d27b3f43
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 39 additions and 0 deletions

25
docker/Dockerfile Normal file
View file

@ -0,0 +1,25 @@
FROM alpine:latest
# 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
# Install Python dependencies
RUN pip install --no-cache-dir --break-system-packages -r /TC2-BBS-mesh/requirements.txt
# Copy configuration script
COPY configini.sh /
# Set permissions for configuration script
RUN chmod +x /configini.sh
# Define config volume
VOLUME /config
# Define working directory
WORKDIR /config
# Define the command to run
CMD ["sh", "-c", " /configini.sh && python3 /TC2-BBS-mesh/server.py"]

7
docker/configini.sh Normal file
View file

@ -0,0 +1,7 @@
#!/bin/sh
if [ ! -f "/config/config.ini" ]; then
cp "/TC2-BBS-mesh/config.ini" "/config/config.ini"
fi
if [ ! -f "/config/fortunes.txt" ]; then
cp "/TC2-BBS-mesh/fortunes.txt" "/config/fortunes.txt"
fi

View file

@ -0,0 +1,7 @@
services:
tc2-bbs-mesh:
build: .
restart: always
volumes:
- ./config:/config
container_name: tc2-bbs-mesh