Skip to Content
Getting Started

Getting Started

Server Setup

Prerequisites:

  • A Debian/Ubuntu server with SSH access
curl -fsSL "https://raw.githubusercontent.com/Shawiizz/dockflow/main/cli/cli_wrapper.sh?$(date +%s)" | bash

The CLI will guide you through:

  • Configuring this server
  • Creating a deployment user
  • Configuring SSH keys
  • Installing Docker and Portainer (optional)

Alternative: Use Docker image

If you prefer using Docker:

docker run -it --rm -v ${HOME}/.ssh:/root/.ssh -v .:/project shawiizz/dockflow-cli:latest

CI/CD Configuration

Create Project Structure

You can use the CLI to automatically generate the project structure:

# GitHub Actions project docker run -it --rm -v .:/project shawiizz/dockflow-cli:latest init github # GitLab CI project docker run -it --rm -v .:/project shawiizz/dockflow-cli:latest init gitlab

This creates the following structure:

.deployment/ β”œβ”€β”€ docker/ β”‚ β”œβ”€β”€ docker-compose.yml # Define your services β”‚ └── Dockerfile.[service] # One per service β”œβ”€β”€ env/ # OPTIONAL: Can use CI secrets instead β”‚ └── .env.[environment] # OPTIONAL: Environment variables └── templates/ β”œβ”€β”€ nginx/ # Custom Nginx configs (optional) β”œβ”€β”€ services/ # Custom systemd services (optional) └── scripts/ # Custom scripts (optional)

Copy CI Config File

GitHub Actions:

example/ci/github-ci.yml β†’ .github/workflows/deploy.yml

GitLab CI:

example/ci/gitlab-ci.yml β†’ .gitlab-ci.yml

⚠️ GitHub users in organizations: Fork this repo and update the uses URL in your workflow file.

Add Repository Secrets

Required secrets in your CI/CD settings:

Secret NameDescriptionExample
[ENV]_CONNECTIONRecommended: All-in-one connection string (Host, User, Key, Password) generated by the CLIPRODUCTION_CONNECTION
[ENV]_SSH_PRIVATE_KEYAlternative: SSH key for main hostPRODUCTION_SSH_PRIVATE_KEY
[ENV]_[HOSTNAME]_SSH_PRIVATE_KEYAlternative: SSH key for specific hostPRODUCTION_SERVER_A_SSH_PRIVATE_KEY
GIT_TOKENOPTIONAL: Remote build optionGitHub/GitLab token

Note: The [ENV]_CONNECTION secret is automatically generated by the CLI during server setup. It contains all necessary connection details (Host, Port, User, Private Key, Password).

Dynamic Variable Override System:

Any CI secret starting with [ENV]_ or [ENV]_[HOSTNAME]_ will automatically override corresponding environment variables.