forked from mudhorn/TC2-BBS-mesh
Merge pull request #7 from upchui/main
Add a Dockerfile for future Docker support Updated (fix fortunes.txt)
This commit is contained in:
commit
81d27b3f43
25
docker/Dockerfile
Normal file
25
docker/Dockerfile
Normal 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
7
docker/configini.sh
Normal 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
|
7
docker/docker-compose.yaml
Normal file
7
docker/docker-compose.yaml
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
services:
|
||||||
|
tc2-bbs-mesh:
|
||||||
|
build: .
|
||||||
|
restart: always
|
||||||
|
volumes:
|
||||||
|
- ./config:/config
|
||||||
|
container_name: tc2-bbs-mesh
|
Loading…
Reference in a new issue