Skip to content

Add docker compose deployment handler #175

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
mew1033 opened this issue Apr 7, 2025 · 3 comments · May be fixed by #178
Open

Add docker compose deployment handler #175

mew1033 opened this issue Apr 7, 2025 · 3 comments · May be fixed by #178

Comments

@mew1033
Copy link

mew1033 commented Apr 7, 2025

I'd like to use the SSH deploy method, but deploy an entire docker compose file with potentially multiple containers. I can probably start adding this myself, but I want to ask where this would fit. Would you like an additional option in image:? Potentially something like ssh-compose? Or would you prefer an entirely new deployment handler?
I envision this process as follows:

  1. Use subprocess to rsync-over-ssh the entire challenge folder to the remote server. Use the same slugify-d name as the directory name on the remote server.
  2. SSH to the remote server and run docker compose up -d in the target directory. Let docker handle all the building/deploying on the remote server.
@pl4nty
Copy link
Contributor

pl4nty commented Apr 7, 2025

I've been doing something similar with custom deployment handlers in ctfcli plugins, so I don't have to fork ctfcli. This compose to k8s plugin looks for a compose file without needing any extra fields in challenge.yml

@mew1033
Copy link
Author

mew1033 commented Apr 8, 2025

I've been doing something similar with custom deployment handlers in ctfcli plugins, so I don't have to fork ctfcli. This compose to k8s plugin looks for a compose file without needing any extra fields in challenge.yml

Nice! I've made a super simple update to the ssh deployer that rsyncs the entire folder over and runs compose up on the remote host.

Also, I totally snagged your github actions workflow over here: https://github.com/pl4nty/auto-CTFd/blob/main/.github/workflows/challenges.yml for our upcoming CTF. It's awesome, thank you!

@mew1033 mew1033 linked a pull request Apr 9, 2025 that will close this issue
@pl4nty
Copy link
Contributor

pl4nty commented Apr 13, 2025

sweet, I'm glad it's useful! is there anything I could do to improve that repo? might start sharing it later this year, I've run a few CTFs with it and other organisers are starting to use it too

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 a pull request may close this issue.

2 participants