Package Your Code
Package your application code for deployment in Container Manager
Before deploying a code-based service via the Web Interface
or API, you need to package your application as a .tar.gz
archive containing your code and dependencies.
Choose Your Packaging Method
You can package your code in two ways:
Using ServiceMaker (Recommended)
ServiceMaker is a command-line tool that automates code preparation for deploying services. It processes standard projects and generates deployment-ready artifacts.
What ServiceMaker automates:
- Builds Docker container images using platform runtime base images.
- Installs and packages project dependencies using
uv. - Generates
.tar.gzarchives ready for upload to Container Manager. - Creates Dockerfile configurations tailored to your project.
- Sets up virtual environments that match platform base images.
- Enables local Docker image testing before deployment.
- Optionally publishes container images to container registries.
- Processes standard project formats (
pyproject.toml,requirements.txt,package.json).
For installation and usage instructions, see the ServiceMaker repository .
Manual Packaging
If you prefer to package your code manually without ServiceMaker, follow the steps below.
- Create a project structure with your application code and entry point script.
- Add a dependency configuration file:
- For Python: Create a
pyproject.tomlwith your dependencies and Python version requirement. - For Node.js: Create a
package.jsonwith your dependencies and a start script.
- For Python: Create a
- Use
uvfor Python projects (recommended):- Ensure your
pyproject.tomlspecifiesrequires-pythonmatching your target runtime (e.g.,">=3.12"for thepy12*base images). - List all dependencies in the
dependenciesarray. - The platform uses
uvto install dependencies during containerization.
- Ensure your
- Create the archive:
tar -czf myservice.tar.gz myproject/ - Test locally (optional but recommended):
- Install dependencies using
uv sync. - Run your entry point script to verify it works before uploading.
- Install dependencies using
Example: Python Project
Project structure:
myproject/
├── pyproject.toml
├── main.py
└── config.json
Example pyproject.toml:
[project]
name = "my-service"
version = "1.0.0"
requires-python = ">=3.12"
dependencies = [
"fastapi>=0.115.0",
"uvicorn[standard]>=0.32.0",
]
Create the archive:
tar -czf myservice.tar.gz myproject/
Example: Node.js Project
Project structure:
myproject/
├── package.json
├── index.js
└── config.json
Example package.json:
{
"name": "my-service",
"version": "1.0.0",
"main": "index.js",
"scripts": {
"start": "node index.js"
},
"engines": {
"node": ">=22"
},
"dependencies": {
"express": "^5.0.0"
}
}
Create the archive:
tar -czf myservice.tar.gz myproject/
Next Steps
Once you have your .tar.gz package ready, you can deploy it using:
