🐳 @pokujs/docker is a minimal API to assist tests that require containers or tests that run inside containers.
Tip
It can be used both with or without Poku test runner.
# Node.js
npm i -D @pokujs/docker |
# Bun
bun add -d @pokujs/docker |
# Deno (optional)
deno add npm:@pokujs/docker |
import { docker } from '@pokujs/docker';
const compose = docker.compose();
// Starts the container(s)
await compose.up();
/**
* Tests come here 🧪
*/
// Stops the container(s)
await compose.down();import { docker } from '@pokujs/docker';
const dockerfile = docker.dockerfile({
containerName: 'container-name',
tagName: 'image-name',
});
// Builds the image from the Dockerfile
await dockerfile.build();
// Starts the container
await dockerfile.start();
/**
* Tests come here 🧪
*/
// Stops and removes both the container and image
await dockerfile.remove();