Automations with docker stacks
This project uses several tools to ensure code quality and consistency:
- MegaLinter: Runs in GitHub Actions to perform comprehensive linting on every Pull Request.
- Pre-commit: Local git hooks to format and lint code before committing.
- Renovate: Automatically manages and updates dependencies.
- EditorConfig: Ensures consistent coding styles across different editors and IDEs.
- Yamlfmt: Specifically handles YAML file formatting.
- GitHub Actions: Workflows for CI, security scans (OSSF Scorecard, Semgrep, etc.), and automerge.
The oci-rm/ directory contains a modular Terraform stack for OCI Resource
Manager that provisions an Ampere A1 (ARM) Always Free VPS, including VCN,
subnet, internet gateway, security rules, and compute instance.
| Resource | Limit |
|---|---|
| Shape | VM.Standard.A1.Flex |
| OCPUs | 4 total across all A1 instances |
| Memory | 24 GB total across all A1 instances |
| Block storage | 200 GB total |
Defaults: 4 OCPU / 24 GB RAM / 200 GB boot volume (Max Always Free).
- Modular Architecture: Clean separation of concerns with network and compute modules.
- Structured Cloud-init: Automatically updates packages and installs
curlandgit. - Configurable Networking: Easily specify additional TCP/UDP ports for ingress.
- ORM Optimized: Enhanced
schema.yamlwith logical grouping and descriptive tooltips.
All variables have sensible defaults. Required inputs:
- Compartment — target OCI compartment
- SSH Public Key — key for instance access
- Cloud-init Script (optional) — paste
scripts/init.shto auto-install Dokploy. This will be wrapped in a structured cloud-config.
-
Zip the stack:
cd oci-rm && zip -r ../oci-rm-stack.zip . && cd ..
-
Open Developer Services → Resource Manager → Stacks in the OCI Console.
-
Click Create Stack → Upload a .zip file → select
oci-rm-stack.zip. -
Fill in the form (variables pre-populated with defaults).
-
Click Apply.
Requires OCI CLI configured (oci setup config).
Update an existing stack's Terraform config:
STACK_ID=<stack-ocid> bash scripts/oci-rm-stack-update.shA1.Flex Free Tier capacity is limited and apply jobs may fail with
500-InternalError, Out of host capacity. Since networking resources are
created first and are idempotent, re-applying the same stack retries only
the instance.
scripts/oci-rm-stack-apply.sh is designed for cron:
- Skips if previous apply already succeeded (idempotent)
- Skips if a job is already in progress
- Prints logs from previous failed job before retrying
- Exits 0 on capacity errors (no cron failure spam)
# Run once
STACK_ID=<stack-ocid> bash scripts/oci-rm-stack-apply.sh
# Run at interval in terminal (every 10 minutes)
export STACK_ID=<stack-ocid>
watch -n 600 bash scripts/oci-rm-stack-apply.sh
# Cron example (every 10 minutes)
*/10 * * * * STACK_ID=<stack-ocid> /path/to/scripts/oci-rm-stack-apply.shThis repository includes a script to automate the setup of Dokploy on an Oracle Cloud Infrastructure (OCI) Ubuntu instance.
The scripts/init.sh script performs the following actions:
- Updates and upgrades system packages.
- Configures
iptablesto allow traffic on essential ports:- 80 (TCP): HTTP traffic.
- 443 (TCP/UDP): HTTPS traffic.
- 3000 (TCP): Dokploy Dashboard.
- Ensures
iptablesrules are persistent across reboots usingiptables-persistent. - Installs Dokploy if it is not already present, or updates it if it is.
When creating a new OCI instance, you can provide the contents of
scripts/init.sh as the Cloud-init script (User Data) to automate the
entire setup process.
You can also run the script manually on an existing Ubuntu instance:
sudo ./scripts/init.shOnce Dokploy is installed, you can access the dashboard at
http://<your-instance-ip>:3000.
Dokploy allows you to easily manage and deploy:
- Docker Compose Stacks: Deploy complex multi-container applications by
providing your
docker-compose.ymldirectly in the Dokploy interface. - Applications: Deploy web applications from GitHub, GitLab, or Bitbucket.
- Databases: Easily provision and manage PostgreSQL, MySQL, MongoDB, and Redis instances.