Platform Suite

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.

Tip:

If you already have a Docker image, you can skip packaging and deploy it directly using a Docker image URL. See Deploy via Web Interface or Deploy via API for details on image-based deployments.

Choose Your Packaging Method

You can package your code in two ways:

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.gz archives 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.

  1. Create a project structure with your application code and entry point script.
  2. Add a dependency configuration file:
    • For Python: Create a pyproject.toml with your dependencies and Python version requirement.
    • For Node.js: Create a package.json with your dependencies and a start script.
  3. Use uv for Python projects (recommended):
    • Ensure your pyproject.toml specifies requires-python matching your target runtime (e.g., ">=3.12" for the py12* base images).
    • List all dependencies in the dependencies array.
    • The platform uses uv to install dependencies during containerization.
  4. Create the archive:
    tar -czf myservice.tar.gz myproject/
    
  5. Test locally (optional but recommended):
    • Install dependencies using uv sync.
    • Run your entry point script to verify it works before uploading.

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: