@pokujs/docker
v1.0.0
Published
🐳 A minimal API to assist tests that require containers or tests that run inside containers.
Maintainers
Readme
@pokujs/docker
Enjoying Poku? Give him a star to show your support 🌟
🐳 @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.
Quickstart
Install
# Node.js
npm i -D @pokujs/docker# Bun
bun add -d @pokujs/docker# Deno (optional)
deno add npm:@pokujs/dockerDocker Compose
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();Dockerfile
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();