diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..f90b9db --- /dev/null +++ b/Dockerfile @@ -0,0 +1,15 @@ +# Use the official Python image +FROM python:3.10-slim + +# Set the working directory in the container +WORKDIR /gupbot + +# Copy the application code into the container +ADD gupbot /gupbot + +# Install required Python packages +RUN pip install --no-cache-dir discord.py + +# Command to run your Python script +CMD ["python", "gupbot.py"] + diff --git a/build_gupbot.sh b/build_gupbot.sh new file mode 100755 index 0000000..e350504 --- /dev/null +++ b/build_gupbot.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +set -e + +# Check if the container is running +if [ "$(docker ps -q -f name=gupbot)" ]; then + echo "Stopping the running container..." + docker stop gupbot +fi + +# Check if the container exists (stopped or running) +if [ "$(docker ps -aq -f name=gupbot)" ]; then + echo "Removing the container..." + docker rm gupbot +fi + +echo "Building the Docker image..." +docker build --network=host -t nalylab/gupbot . + +echo "Running the Docker container..." +docker run --network=host --name=gupbot -d nalylab/gupbot + diff --git a/example_guptoken.py b/gupbot/example_guptoken.py similarity index 100% rename from example_guptoken.py rename to gupbot/example_guptoken.py diff --git a/gupbot.py b/gupbot/gupbot.py similarity index 100% rename from gupbot.py rename to gupbot/gupbot.py diff --git a/insult_generator.py b/gupbot/insult_generator.py similarity index 100% rename from insult_generator.py rename to gupbot/insult_generator.py