You need A ComputeSphere account and csph set up, from lesson 5.1.1, Set up; your sample from lesson 3.8.5 with its Dockerfile; and a Docker Hub or GitHub account.
No ComputeSphere account or csph yet?
Follow lesson 5.1.1, Set up: sign up, create the learn project and its lab environment, install csph, and run the use commands. csph context should show learn and lab.
Replace <you> with your Docker Hub or GitHub username, in lower case, and <language> with node, python or go.
Build for ComputeSphere
In your sample's folder:
docker build --platform linux/amd64 -t docker.io/<you>/containerize-<language>:1.0.0 .docker build --platform linux/amd64 -t ghcr.io/<you>/containerize-<language>:1.0.0 .ComputeSphere runs spherelets on amd64 machines. On an Apple silicon Mac, Docker builds for arm64 unless you say otherwise.
You should seeThe build finishes and names your image.
Push it
Sign in with your token as in lesson 3.5.3 (a classic token with
write:packagesfor GitHub):read -s CR_PAT # paste the token, then Enter echo "$CR_PAT" | docker login -u <you> --password-stdin unset CR_PAT docker push docker.io/<you>/containerize-<language>:1.0.0read -s CR_PAT # paste the token, then Enter echo "$CR_PAT" | docker login ghcr.io -u <you> --password-stdin unset CR_PAT docker push ghcr.io/<you>/containerize-<language>:1.0.0On GitHub, the package starts private: open it under your profile's Packages, then Package settings, and change its visibility to Public.
You should seeLogin Succeeded, then layers uploading and a line with your tag and a sha256 digest.
Write computesphere.yaml
version: "2" services: - name: ship-container type: web-service # or ghcr.io/<you>/containerize-<language>:1.0.0 image: docker.io/<you>/containerize-<language>:1.0.0 port: 3000 health_check_path: /healthzUse your full image name from step 1.
portis where the app listens (the console's Port); the last line sets the health check's Endpoint path and turns it on.You should seeThe file saved next to your Dockerfile.
Deploy it
csph deploy --file computesphere.yamlCheck yourself
You should see✓ ship-container (web-service) — created, then ✓ deployment … is Running and your URL.
Prove it with the URL
curl -i https://<your-ship-container-url>/healthzcsph can report success before an update is healthy, so the URL is your proof.
You should seeHTTP/2 200 and {"status":"ok"}.
Confirm the health check
In the console, open
ship-container, then Settings, and find the Health check card.You should seeThe Health check card shows Path /healthz and Port 3000.
Check your work
If this doesn't pass
Failed with an image error: check the image is public and the name matches what you pushed. Failed after starting: the image may be arm64; rebuild with --platform linux/amd64, push, and deploy again.
If this doesn't pass
If it's Running but doesn't answer, check port is 3000, the port your app listens on.
If this doesn't pass
Check health_check_path in computesphere.yaml is /healthz, then deploy the file again.