diff --git a/docker/Dockerfile b/docker/Dockerfile new file mode 100644 index 0000000..535b71d --- /dev/null +++ b/docker/Dockerfile @@ -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"] \ No newline at end of file diff --git a/docker/configini.sh b/docker/configini.sh new file mode 100644 index 0000000..0bf4a4d --- /dev/null +++ b/docker/configini.sh @@ -0,0 +1,4 @@ +#!/bin/sh +if [ ! -f "/config/config.ini" ]; then + cp "/TC2-BBS-mesh/config.ini" "/config/config.ini" +fi \ No newline at end of file diff --git a/docker/docker-compose.yaml b/docker/docker-compose.yaml new file mode 100644 index 0000000..88266b0 --- /dev/null +++ b/docker/docker-compose.yaml @@ -0,0 +1,7 @@ +services: + tc2-bbs-mesh: + build: . + restart: always + volumes: + - ./config:/config + container_name: tc2-bbs-mesh \ No newline at end of file