Add a Dockerfile for future Docker support

This commit is contained in:
thealhu 2024-06-27 19:25:35 +02:00
parent 6ba34ebf77
commit df6b70a365
3 changed files with 36 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"]

4
docker/configini.sh Normal file
View file

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

View file

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