https://github.com/eastlondoner/mineflare
GitHub
Contribute to eastlondoner/mineflare development by creating an account on GitHub.
preview.domain.com and have the PR number be either a prefix of the domain or an url so like <pr>.preview.domain.com or preview.domain.com/<pr>@cloudflare/sandbox package and the docker.io/cloudflare/sandbox Docker image. Was getting only a very generic SandboxError with no other details which made it hard to track down.
wget on from my home network. :sad_frog: (using a public R2 bucket for the test)





getRandom(env.API, 25) to a more reasonable valuepreview.domain.com<pr>.preview.domain.compreview.domain.com/<pr>@cloudflare/sandboxdocker.io/cloudflare/sandboxSandboxErrorwgetjs import { Container, getRandom } from "@cloudflare/containers";
interface Env {
API: any; // Container binding
API_KEY: string;
CLEANUP_TEMP_FILES: string;
LOG_LEVEL: string;
PORT: string;
R2_ACCESS_KEY_ID: string;
R2_BUCKET_NAME: string;
R2_ENDPOINT_URL: string;
R2_PUBLIC_URL: string;
R2_SECRET_ACCESS_KEY: string;
}
export class PowerpointApi extends Container {
declare env: Env;
defaultPort = 8000;
sleepAfter = "2m";
envVars: Record<string, string> = {
API_KEY: this.env.API_KEY,
CLEANUP_TEMP_FILES: this.env.CLEANUP_TEMP_FILES,
LOG_LEVEL: this.env.LOG_LEVEL,
PORT: this.env.PORT,
R2_ACCESS_KEY_ID: this.env.R2_ACCESS_KEY_ID,
R2_BUCKET_NAME: this.env.R2_BUCKET_NAME,
R2_ENDPOINT_URL: this.env.R2_ENDPOINT_URL,
R2_PUBLIC_URL: this.env.R2_PUBLIC_URL,
R2_SECRET_ACCESS_KEY: this.env.R2_SECRET_ACCESS_KEY,
};
override onStart() {
console.log("Container successfully started");
}
override onStop() {
console.log("Container successfully shut down");
}
override onError(error: unknown) {
console.log("Container error:", error);
}
}
export default {
async fetch(request: Request, env: Env): Promise<Response> {
const container = await getRandom(env.API, 25);
return await container.fetch(request);
},
} satisfies ExportedHandler<Env>;image = "./Dockerfile"
max_instances = 25
instance_type = "standard-4" const container = getContainer(env.MY_CONTAINER);
const containerState = await container.getState();
if (containerState.status === "stopped") {
await container.startAndWaitForPorts({
startOptions: {
envVars: {
OPENSTATUS_KEY: env.OPENSTATUS_KEY,
},
},
});
} else {
await container.renewActivityTimeout();
}There is no container instance that can be provided to this Durable Object, try again later getRandom(env.API, 25)