About
RunContainers is an opinionated platform to simply run containers.
We’re creating some docs to povide some examples of what can be done through our APIs. OpenAPI Spec: https://api.runcontainers.nz/docs
Here’s a Curl example:
curl -X PUT "https://api.runcontainers.nz/run/workload" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer BEARER_TOKEN" \
-d @docker-compose.jsonHere’s a JS example:
async function runCompose(url, dockerComposeData) {
try {
const response = await fetch(url, {
method: 'PUT',
headers: {
'Content-Type': 'application/json'
'Authorization': `Bearer ${bearerToken}`
},
body: JSON.stringify(dockerComposeData)
});
if (!response.ok) {
throw new Error(`HTTP error! Status: ${response.status}`);
}
const result = await response.json();
console.log('Success:', result);
} catch (error) {
console.error('Error:', error);
}
}
const dockerComposeData = {
version: "3",
services: {
web: {
image: "nginx",
ports: ["80:80"]
}
}
};
const bearerToken = "BEARER_TOKEN";
runCompose("https://api.runcontainers.nz/run/workload", dockerComposeData, bearerToken);
}Check out the following repos for some workload examples:
Links to our policies: