Updated for compose

This commit is contained in:
2025-08-13 18:25:01 +10:00
parent 68d366822b
commit ab56bd5319

View File

@@ -11,22 +11,33 @@ trigger:
steps:
- name: restart-bot # Name of this specific step in the pipeline.
image: docker:latest # Uses the official Docker image, which includes the Docker CLI.
# This volume mount allows the Docker CLI inside the Woodpecker agent container
# to communicate with the Docker daemon on the host machine. This is crucial
# for being able to restart containers running on the host.
image: docker/compose:latest # Uses a Docker Compose-enabled image.
# This volume mount allows the Docker Compose CLI inside the Woodpecker agent container
# to communicate with the Docker daemon on the host machine.
volumes:
- name: docker_sock
path: /var/run/docker.sock
# IMPORTANT: Mount the directory where your docker-compose.yml file resides.
# Replace '/path/to/your/bot/docker-compose' with the actual path on your host machine.
- name: docker_compose_dir
path: /app # This is the path inside the container where the compose file will be accessible.
commands:
# The command to restart your Discord bot container.
# IMPORTANT: Replace 'YOUR_DISCORD_BOT_CONTAINER_NAME' with the actual name
# of your Discord bot's Docker container.
# You can find the container name using 'docker ps' on your server.
- docker restart YOUR_DISCORD_BOT_CONTAINER_NAME
# Navigate into the directory where the docker-compose.yml file is mounted.
- cd /home/gary/Discord/Acrybot
# The command to restart your Discord bot service using Docker Compose.
# IMPORTANT: Replace 'your_bot_service_name' with the actual service name
# defined in your docker-compose.yml file.
# Use 'docker compose' for newer Docker versions (v2) or 'docker-compose' for older ones.
- docker compose restart python-app
# - docker-compose restart your_bot_service_name # Uncomment this line if you use older Docker Compose.
# Defines the volumes that are available to the steps in this pipeline.
volumes:
- name: docker_sock # A named volume.
- name: docker_sock # A named volume for the Docker socket.
host:
path: /var/run/docker.sock # Maps the Docker socket from the host into the container.
- name: docker_compose_dir # A named volume for your Docker Compose project directory.
host:
# IMPORTANT: Replace '/path/to/your/bot/docker-compose' with the actual absolute path
# on your host machine where your docker-compose.yml file is located.
path: /home/gary/Discord/Acrybot