CD-DC (Continuous Deployment Docker Compose) is a simple service to continuously deploy docker containers in a docker compose stack. The tool is especially useful in a GitHub Actions workflow.
Send a post request to the /upgrade/<service>
endpoint:
curl <cd-dc-host>/upgrade/<service> -X POST -H <api-key> --fail-with-body
-
Build the binary
go build -o build/cd-dc ./cmd
-
Copy the binary to
/opt/cd-dc
-
Copy the
config.yml
to/opt/cd-dc
and modify it accordingly -
Create a systemd service file in
/etc/systemd/system/cd-dc.service
[Unit] Description=CD-DC After=network.target [Service] ExecStart=/opt/cd-dc/cd-dc WorkingDirectory=/opt/cd-dc [Install] WantedBy=default.target
-
Enable the service
sudo systemctl enable cd-dc
-
Start the service
sudo systemctl start cd-dc
-
Check the status
sudo systemctl status cd-dc
-
Check the logs
sudo journalctl -u cd-dc
- Copy the new binary to
/opt/cd-dc
- Reload the systemd daemon
sudo systemctl daemon-reload
- Restart the service
sudo systemctl restart cd-dc
go run ./cmd
env GOOS=linux GOARCH=arm64 go build -ldflags "-w" -o build/cd-dc ./cmd