Skip to content

pokujs/docker

Poku's Logo

@pokujs/docker

Enjoying Poku? Give him a star to show your support 🌟


📘 Documentation


🐳 @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/docker

Docker 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();

About

🐳 A minimal API to assist tests that require containers or tests that run inside containers.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Sponsor this project

 

Contributors 2

  •  
  •