ConceptsDockerize your app

Dockerizing your session backend

You can use any language or framework in a session backend. If you can run it in a Docker container, you can run it on Jamsocket.

For common languages (including Node.js, Python, Go, and Rust), you can let Docker automatically containerize your app by running:

docker init

Here are a few details to keep in mind when Dockerizing your session backend code:

1. Your session backend container must run a server that listens on port 8080 and binds to the local IPv4 address 0.0.0.0.

If you are using a framework or an existing Docker container, you may need to explicitly tell it to listen on port 8080 and set the host to 0.0.0.0.

2. Your session backend container must be built to run on an x86 architecture.

If you use the --dockerfile flag when pushing to Jamsocket, the Jamsocket CLI will build your image for the correct platform. For example,

npx jamsocket push [SERVICE NAME] --dockerfile path/to/Dockerfile

If instead you are building your own docker image, you should be sure to build for the correct platform so that the resulting image can run on Jamsocket’s VMs. For example,

docker build --platform=linux/amd64 ...
💡

Session backends may encounter a terminated status after starting if their images are built for the wrong platform.

Built by Jamsocket.