Skip to content

add support for pre_start and post_start scripts #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

prabirshrestha
Copy link

Added pre_start and post_start scripting support in stack-deploy.toml.

This will allow us to run custom scripts and can be useful when setting us networks for reverse proxy that is external.

Example for pre_start script for creating a network for traefik.

#!/bin/sh
NETWORK_NAME="reverse_proxy"

if ! docker network ls --filter name=^${NETWORK_NAME}$ --format "{{.Name}}" | grep -wq ${NETWORK_NAME}; then
  echo "Network '${NETWORK_NAME}' does not exist. Creating it now..."
  docker network create ${NETWORK_NAME}
else
  echo "Network '${NETWORK_NAME}' already exists."
fi

I also pass the secret_env so this could be used to replace values in config files that is outside of compose.yml.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant