Skip to main content

Deployment Requirements

Clue2App automatically detects and builds your applications. This guide covers the requirements for successful deployments.

Supported Languages

Clue2App automatically detects and builds applications written in:

LanguageFrameworks
PythonFastAPI, Flask, Django, etc.
Node.jsExpress, Next.js, React, Vue, etc.
JavaSpring Boot, Quarkus, etc.
GoStandard library, Gin, Echo, etc.
.NET CoreASP.NET, Blazor, etc.

Project Structure

Detection Files

Clue2App needs specific files at the repository root to detect your application:

LanguageRequired File
Pythonrequirements.txt, pyproject.toml, or setup.py
Node.jspackage.json
Javapom.xml or build.gradle
Gogo.mod
.NET*.csproj or *.fsproj

Monorepo / Subdirectory Projects

If your code is in a subdirectory (e.g., backend/), create wrapper files at the root:

Python Example

my-repo/
├── requirements.txt # Points to backend
├── Procfile # Runs from backend
├── backend/
│ ├── requirements.txt # Actual dependencies
│ └── app/
│ └── main.py
└── frontend/
└── ...

Root requirements.txt:

-r backend/requirements.txt

Root Procfile:

web: cd backend && uvicorn app.main:app --host 0.0.0.0 --port 8000

Node.js Example

my-repo/
├── package.json # Wrapper
├── Procfile # Runs from backend
├── backend/
│ ├── package.json
│ └── src/
└── frontend/
└── ...

Root package.json:

{
"name": "app-wrapper",
"scripts": {
"start": "cd backend && npm start"
}
}

Procfile

A Procfile specifies how to run your application. It's optional for simple projects but recommended for:

  • Monorepo projects
  • Custom startup commands
  • Specific runtime configurations

Format:

web: <command to start your app>

Examples:

# Python FastAPI
web: uvicorn app.main:app --host 0.0.0.0 --port 8000

# Python Flask
web: gunicorn app:app --bind 0.0.0.0:8000

# Node.js
web: node server.js

# Java
web: java -jar target/app.jar

Port Configuration

Your application must listen on the PORT environment variable (defaults to 8080):

Python:

import os
port = int(os.environ.get("PORT", 8080))

Node.js:

const port = process.env.PORT || 8080;

Java:

int port = Integer.parseInt(System.getenv().getOrDefault("PORT", "8080"));

Environment Variables

Set environment variables via:

  • Console: App Settings → Environment Variables
  • CLI: c2a env set <app> KEY=value

Common variables:

VariablePurpose
DATABASE_URLDatabase connection string
SECRET_KEYApplication secret
NODE_ENVNode.js environment
LOG_LEVELLogging verbosity

Troubleshooting

Build fails with "detection error"

Cause: Required files not found at repository root.

Solution:

  1. Ensure detection files (requirements.txt, package.json, etc.) are at the repo root
  2. For subdirectory projects, create wrapper files as shown above

Build succeeds but app crashes

Cause: Missing configuration or incorrect startup command.

Solution:

  1. Check app logs: c2a logs show <app-name>
  2. Verify Procfile command is correct
  3. Ensure all required environment variables are set

App not accessible

Cause: App not listening on correct port.

Solution:

  1. Ensure your app reads the PORT environment variable
  2. Default to port 8080 if PORT is not set
  3. Bind to 0.0.0.0, not localhost

Best Practices

  1. Keep dependencies minimal - Faster builds, smaller images
  2. Use a Procfile - Explicit is better than implicit
  3. Set PORT dynamically - Don't hardcode ports
  4. Use environment variables - Never commit secrets
  5. Test locally first - Ensure your app runs before deploying