Deployment Configuration
Configure how your application is built and deployed. This covers everything from your Dockerfile to environment variables to health check endpoints.
Dockerfile
Section titled “Dockerfile”Reoclo expects a Dockerfile in your repository. This is used to build the Docker image directly on your target server.
Default Path
Section titled “Default Path”The default path is ./Dockerfile at the repository root. You can configure a different path in your application settings if your Dockerfile lives elsewhere (for example, ./docker/Dockerfile or ./services/api/Dockerfile).
Standard Docker Build
Section titled “Standard Docker Build”Reoclo runs a standard docker build command. Whatever works locally will work on Reoclo. There are no special requirements or custom build steps.
The build context is the repository root, so your Dockerfile can reference any files in the repo using relative paths.
.dockerignore
Section titled “.dockerignore”Reoclo respects .dockerignore files. Use this to exclude files from the build context (for example, .git, node_modules, test files, documentation).
A smaller build context means faster uploads to the Docker daemon and faster builds.
Environment Variables
Section titled “Environment Variables”Environment variables are how you pass configuration and secrets to your application. Set them in the dashboard under Application → Settings → Environment Variables.
How They Work
Section titled “How They Work”- You add environment variables in the dashboard (key-value pairs)
- Reoclo encrypts them at rest
- During deployment, Reoclo securely injects them into the container
Security Model
Section titled “Security Model”Environment variables are write-only after you save them. You can update or delete them, but you cannot read them back through the dashboard.
Common Use Cases
Section titled “Common Use Cases”- Database connection strings
- API keys for third-party services
- Feature flags
- Application secrets (session secrets, signing keys)
- Service URLs
Example
Section titled “Example”REDIS_URL=redis://cache.example.com:6379API_KEY=sk_live_abc123xyz789NODE_ENV=productionThese are injected into your container as standard environment variables. Access them in your application code the same way you would locally.
Reoclo also sets a few variables itself from your domains. See Variables Reoclo Sets.
Port Configuration
Section titled “Port Configuration”Specify the port your application listens on inside the container. This is set during application creation and can be updated in the settings.
Reoclo maps this to an available host port on the server. You do not choose the host port (it is allocated automatically), but you do specify the container port.
Example
Section titled “Example”If your application listens on port 3000 inside the container, set the port to 3000. Reoclo might map this to a host port on the server, but your application code does not need to know that. It just listens on 3000 as usual.
Health Check
Section titled “Health Check”Define a health check path that Reoclo polls after starting a new container. This is critical for safe deployments.
What Makes a Good Health Check
Section titled “What Makes a Good Health Check”A good health check verifies your application is ready to serve requests, not just that the process started.
Bad health check:
app.get('/health', (req, res) => { res.status(200).send('OK');});This returns 200 as soon as the HTTP server starts, even if the database connection is broken or the cache is not ready.
Good health check:
app.get('/health', async (req, res) => { try { // Verify database connectivity await db.ping();
// Verify cache connectivity await cache.ping();
// Check critical dependencies if (!config.isValid()) { throw new Error('Invalid configuration'); }
res.status(200).json({ status: 'healthy' }); } catch (error) { res.status(503).json({ status: 'unhealthy', error: error.message }); }});This checks that all critical dependencies are available before returning 200.
Health Check Timeout
Section titled “Health Check Timeout”If your health check does not respond with HTTP 200 within the timeout period, the deployment fails and rolls back to the old container.
Make sure your health check responds quickly (under 5 seconds is ideal). If your app needs a long warmup, consider implementing a readiness check that returns 503 during warmup and 200 when ready.
Where HTTP and TCP Checks Run
Section titled “Where HTTP and TCP Checks Run”For an application that publishes a host port, Reoclo checks that port on the server. When nothing on the host answers for the application, as with internal-only applications and every application on a server whose proxy Reoclo manages, HTTP and TCP checks run from a short-lived busybox container that shares the application container’s network, against the container port. The server pulls busybox from Docker Hub the first time. The regular health checks shown on the application run the same way.
Common Paths
Section titled “Common Paths”/health/api/health/healthz/_health
Choose a path that does not conflict with your application routes.
Command Checks
Section titled “Command Checks”A health check can also run a command inside the container. Set it with reoclo apps config set <app> --health-check 'command:<cmd>', or in a compose file with healthcheck:. The check passes when the command exits with code 0.
- A command given as a string, or a compose
CMD-SHELLtest, runs throughsh -cinside the container, so$VARexpansion, pipes and&&work. - A compose
CMDlist runs with no shell. Each list item is one argument, and$VARis not expanded. - In a compose file,
$$escapes a literal$. Reoclo removes that escaping before it runs the command, so write$$POSTGRES_USERin the compose file and expect$POSTGRES_USERat run time.
Make sure the check fails when the service is not ready. Some readiness tools report success even when they are given arguments that cannot work. For example, pg_isready -U nosuchrole -d nosuchdb exits with code 0 as long as the Postgres server accepts connections, because it only tests the connection and never logs in. A check with a mistyped role or database name stays green.
Prefer one of these instead:
pg_isreadywith the role and database in the container environment, so there are no arguments to get wrong: setPGUSERandPGDATABASEon the service and run plainpg_isready.psql -U "$POSTGRES_USER" -d "$POSTGRES_DB" -c 'select 1', which logs in and runs a query, so a wrong role or database fails.mysqladmin pingfor MySQL and MariaDB.redis-cli pingfor Redis.
Test a command by hand before you rely on it: docker exec <container> sh -c '<cmd>'; echo $?. A check that exits 0 when you give it bad input does not protect you.
Health Without a Reoclo Check
Section titled “Health Without a Reoclo Check”When an application has no health check of its own, for example a stack member whose compose file defines no healthcheck:, its health no longer reads as unknown if the container has a Docker health check. Reoclo shows the health Docker reports for the container and marks it source: docker. This needs runner 1.43.0 or newer. A starting container reads as unknown until Docker marks it healthy or unhealthy. A check you configure in Reoclo always takes priority over the Docker value.
Docker Compose Services
Section titled “Docker Compose Services”The health check settings on this page apply to Dockerfile and image deployments. For a Docker Compose application, Reoclo reads service state from docker compose ps after docker compose up. It checks the selected compose service, or every service in the file when no service is selected:
- Each checked service must be
running. When no service is selected, a service that exited with code 0 (a one-shot job such as a migration) counts as complete, but the service named like the application must be running, and at least one service must be running. - If the compose file defines a
healthcheck:for a checked service, that service must also reporthealthy. Reoclo waits while Docker reportsstarting, up to about two minutes.
If a service is not running or not healthy, the deploy log shows the state of each service and the last log lines of the service, and the deploy is rolled back. If Reoclo cannot read the service state at all (for example docker compose ps fails), it leaves the containers in place and reports that, so you can inspect the server.
The service does not need to publish a host port. A service that only uses expose: (for example, one that sits behind a reverse proxy on the Docker network) verifies the same way. Use a compose healthcheck: to make the deploy wait for real readiness:
services: api: build: . expose: - "3000" healthcheck: test: ["CMD", "wget", "-qO-", "http://localhost:3000/health"] interval: 10s timeout: 5s retries: 3 start_period: 20sOn a server that runs the managed proxy, a compose service does not publish the ports: from its compose file when you select a compose service for the application, the application has a bound domain, and its proxy enforcement is set to Enforce. Reoclo resets that list at deploy time, so the proxy is the only way in and it never has to recreate the container to remove a host port. Set the application’s enforcement to Opt out to keep the host ports. This needs Compose 2.24 or newer on the server. With an older Compose the deploy log says so, and the proxy removes the host ports after the deploy instead. An application that deploys a whole compose file without a selected service keeps its host ports at deploy time, and the proxy removes them afterwards.
Environment, Resource Limits and Builds for Docker Compose
Section titled “Environment, Resource Limits and Builds for Docker Compose”When you select a compose service for the application, Reoclo passes the application’s environment variables and linked secrets to that service through a small compose file it generates at deploy time. Your compose file does not need env_file: .env, and it is never rewritten. Values under the service’s own environment: still win, and any env_file entries you declare are kept. Other services in the file only see the Reoclo environment through ${VAR} interpolation, so add env_file: .env to any of them that need it. Without a selected service, the environment is written to .env for interpolation only, and the deploy log says so.
The application’s resource limits apply to the selected service when they differ from the defaults (1 CPU, 512 MB) and your compose file does not set that limit itself. A limit in the compose file (mem_limit, cpus or deploy.resources.limits) always wins. The deploy log lists the limits Reoclo applied.
A deploy builds the selected service together with every service it depends on through depends_on, so a dependency with a build: section is rebuilt and recreated when its source changes. This needs Compose 2.24 or newer. With an older Compose, only the selected service is built, and the deploy log says so.
On a server that runs the managed proxy, a routed compose service joins the proxy network when its container is created, so its domain keeps serving through a redeploy.
Auto-Deploy
Section titled “Auto-Deploy”Enable auto-deploy to trigger deployments automatically when you push to the configured branch. This uses the GitHub App webhook to detect pushes.
See Wait for CI before a deployment to make an automatic deployment wait for the commit’s CI checks first.
When to Enable
Section titled “When to Enable”- Staging environments: Auto-deploy keeps your staging server in sync with the latest code
- Development servers: Continuous deployment for rapid iteration
- Preview environments: Automatically deploy feature branches
When to Disable
Section titled “When to Disable”- Production apps: Manual approval before deploying to production
- Regulated environments: Compliance requirements for change control
- High-traffic apps: Controlled deployment windows to minimize risk
You can enable or disable auto-deploy at any time in the application settings.
Build Context
Section titled “Build Context”The entire repository is cloned to the server (shallow clone for speed). The Docker build context is the repository root.
This means your Dockerfile can reference any files in the repo:
COPY package.json ./COPY src/ ./src/COPY public/ ./public/All of these paths are relative to the repository root.
Git Submodules
Section titled “Git Submodules”Reoclo does not fetch git submodules by default, so a submodule folder is empty in the build context. To fetch them, open the application’s Settings tab and set Git submodules:
- Off: submodule folders stay empty. This is the default.
- Top level: fetch the submodules listed in the repository’s
.gitmodulesfile. - Recursive: also fetch the submodules inside those submodules.
The setting applies to deployments and preview deployments of the application. The deploy log shows a Fetching submodules line when it is on.
Reoclo fetches submodules with the same GitHub App access it uses for the repository. A private submodule must live in a repository that the Reoclo GitHub App installation can access: install the app on the owner of that repository and include it. If a submodule cannot be fetched, the clone step fails and the log names the submodule path and URL, so a build never runs against an empty folder.
Submodule URLs written for SSH, such as [email protected]:acme/lib.git or ssh://[email protected]/acme/lib.git, are fetched over HTTPS from the same host as the repository. Your server needs no SSH key. A submodule on a different host is fetched as written, without credentials, so it must be public: Reoclo sends the repository’s access token only to the repository’s own host.
Each submodule is fetched shallow. If the git host refuses a shallow fetch of the pinned commit, Reoclo retries that fetch with full history.
Build Arguments
Section titled “Build Arguments”If you need to pass build arguments to docker build, you can configure them in the application settings. These are passed as --build-arg flags.
Example use case: passing a build timestamp or commit SHA into the image.
ARG BUILD_TIMEARG COMMIT_SHA
LABEL build_time=$BUILD_TIMELABEL commit_sha=$COMMIT_SHADeployment Logs
Section titled “Deployment Logs”Every deployment generates a full log of the pipeline execution. You can view these logs in the dashboard by clicking on a deployment in the history.
Logs include:
- Repository clone output
- Docker build output (all layers)
- Container startup output
- Health check results
- Rollback output (if the deployment failed)
Use these logs to debug build failures, health check failures, or runtime errors.
Configuration as code (reoclo.yml)
Section titled “Configuration as code (reoclo.yml)”Everything on this page also has a file form: reoclo.yml. Reoclo reads the file from your repository at each deployed commit.
The file lives in one of two locations:
<base_directory>/reoclo.yml: the file’s location identifies the application.ci/reoclo/<label>.yml: one file for each application, with a top-levelapp:selector.
When the file sets a key, the file’s value wins over the dashboard setting for that key. When the file does not set a key, the dashboard setting applies. The dashboard shows Set by reoclo.yml on a setting the file controls.
The setup wizard’s repository scan finds these files at the same two locations. See the reoclo.yml reference for every key, its type, and its default.
Next Steps
Section titled “Next Steps”- Understand the deployment pipeline to see how all these pieces fit together
- Review security practices to understand how environment variables are protected
- Set up server connections to configure where your code deploys