Environment Variables
Environment variables let you inject configuration into your apps at runtime without baking secrets into your Docker image.
Setting variables at creation
Section titled “Setting variables at creation”Use the --env flag when creating an app. You can pass multiple variables:
zerokie apps create \ --name my-api \ --image my-registry.com/my-api:latest \ --port 3000 \ --env DATABASE_URL=postgres://user:pass@host:5432/db \ --env NODE_ENV=productionEach --env flag sets one variable in the format KEY=VALUE.
Common use cases
Section titled “Common use cases”| Variable | Purpose |
|---|---|
DATABASE_URL | Database connection string |
NODE_ENV | Node.js environment (production, development) |
API_KEY | Third-party service credentials |
PORT | Override the default listening port (if your app reads $PORT) |
Security considerations
Section titled “Security considerations”Environment variables are stored securely within the platform infrastructure and are only exposed to the running container. They are not visible in logs or API responses.
Avoid passing sensitive values directly on the command line in shared environments. Consider using a secrets manager and injecting references instead.
Next steps
Section titled “Next steps”- Set resource limits to control CPU and memory allocation.
- See the full CLI Reference for all available flags.