Custom Templates
Overview
Custom Templates allow you to create application components with technology stacks that are not covered by CodeNOW’s predefined scaffolders. You define how the component is built and deployed by providing your own Dockerfile and/or Helm charts.
- Use
Docker Genericwhen you want to supply both a Dockerfile and Helm charts. - Use
Helm Genericwhen you want to keep CodeNOW’s default image build but provide your own Helm charts. - For existing scaffolded components, you can expose and customize the default Dockerfile and Helm charts stored in the component repository.
This page provides concise, manual-only guidance and links to the relevant manuals. Tutorials and step-by-step examples are intentionally omitted here.
When to Use Custom Templates
- Your stack is not available among supported technology stacks.
- You need full control over the container image and deployment manifests.
- You want to deploy a third-party image with custom Helm configuration.
By defining the build and deployment of your custom stack, you are responsible for troubleshooting and maintaining your configuration.
Options
- Expose and customize Dockerfile and Helm charts of an existing component.
- Go to your component’s repository and enable visibility of Dockerfile and Helm files; then edit as needed.
- Create a component with Docker Generic (custom Dockerfile + Helm charts).
- Create a component with Helm Generic (custom Helm charts, reuse default image build).
Configuration and Deployment
- Manage deployment configuration via Configuration management.
- Use
/codenow/config/helm-values.yamlto parameterize Helm charts per environment. - Connect services using Connect Service to Component.
Good Practices
- Expose port
80in your container; CodeNOW expects services to run on port 80. - Prefer starting from well-known Helm charts when possible (e.g., charts on Artifact Hub).
- Keep secrets out of repository files; manage them via CodeNOW service connections and environment variables.
Related Manuals
- Application Components
- Configuration management
- Managed Services
- External Services
- Connect Service to Component
Edit Default Dockerfile and Helm Charts
For scaffolded components, enable visibility of the default Dockerfile and Helm files in your repository and edit them to adapt the stack and deployment.
Prerequisites:
- Existing application and component created with a predefined scaffolder.
Steps (high level):
- Open component repository; toggle Dockerfile visibility; toggle Helm files visibility.
- Edit Dockerfile to adjust base image, runtime, ports.
- Edit Helm charts to adapt deployment, resources, and ingress.
Create Component with Docker Generic
Create a component and configure both its Dockerfile and Helm charts. The Docker Generic scaffolder gives you full freedom over your stack and deployment.
Prerequisites:
- Existing application in CodeNOW.
Steps (high level):
- Create new component; select
Docker Generic. - Provide Dockerfile and Helm charts in the repository.
- Build and deploy using your configuration.
Create Component with Helm Generic
Reuse CodeNOW’s default image build while providing your own Helm charts.
Prerequisites:
- Existing application in CodeNOW.
Steps (high level):
- Create new component; select
Helm Generic. - Edit Helm charts in the repository; adapt values and templates.
Helm Chart Overrides
When using Helm Generic or Docker Generic, CodeNOW creates /codenow/config/helm-values.yaml in the component repository. Use this file to set environment-specific values.
- Update values via deployment configurations.
- Maintain different settings for
dev,preprod, andproddeployments.
Tips
-
Configuring via Helm requires familiarity with Helm templates and values.
-
Explore Docker Hub for trusted base images.
-
Keep ports and probes aligned with your stack; expose port
80. -
Your application must return an HTTP
**200 OK**success status code in response to aGETrequest to its deployment URL (cf. NodeJS/Express API example).
Deployment configuration files
- By default, all files in the
/codenow/configfolder are deployed as is to the/codenow/configrepository of the deployed container. - This default behavior is implemented by Helm configuration files. You can change it by modifying the Helm files for your component (see Edit a component's Helm chart and Helm charts override).
- You may customize the deployment folder for the configuration files by updating the Helm files.
- Applications can access any deployment configuration files used in a CodeNOW deployment in the
/codenow/configrepository of the deployed container.
Runtime environment variables
- CodeNOW creates automatically runtime environment variables for connection properties. Use the method provided by your custom stack to access environment variables at runtime (e.g.,
process.envin NodeJS scripts,os.environin Python).
Troubleshooting
- Do not hesitate to contact our support team!