You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+78-2Lines changed: 78 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,82 @@
1
1
# PodKeeper
2
2
3
-
PodKeeper is an open-source library for starting and stopping Docker containers in a way that ensures they won’t linger if the host program crashes or exits unexpectedly without properly stopping them.
3
+
> ⚠️ **Warning:** PodKeeper is currently in pre-1.0.0 release. Expect potential changes and experimental features that may not be fully stable yet.
4
+
5
+
PodKeeper is a node.js open-source library for starting and stopping Docker containers in a way that ensures they won’t linger if the host program crashes or exits unexpectedly without properly stopping them.
6
+
7
+
PodKeeper is written in TypeScript and comes bundled with TypeScript types.
8
+
9
+
-[Getting Started](#getting-started)
10
+
-[Bundled Services & API](#bundled-services--api)
11
+
-[How It Works](#how-it-works)
12
+
-[PodKeeper vs. TestContainers](#podkeeper-vs-testcontainers)
13
+
14
+
## Getting Started
15
+
16
+
1. Install podkeeper:
17
+
18
+
```sh
19
+
npm i --save-dev podkeeper
20
+
```
21
+
22
+
1. Pull container you wish to launch beforehand:
23
+
24
+
```sh
25
+
docker pull postgres:latest
26
+
```
27
+
28
+
1. Start / stop container programmatically:
29
+
30
+
```ts
31
+
import { Postgres } from 'podkeeper';
32
+
33
+
const postgres = await Postgres.start();
34
+
// do something with container...
35
+
await postgres.stop();
36
+
```
37
+
38
+
## Bundled services & API
39
+
40
+
PodKeeper comes bundled with the following pre-configured services:
41
+
42
+
* MySQL:
43
+
44
+
```ts
45
+
import { MySQL } from 'podkeeper';
46
+
```
47
+
48
+
* Postgres
49
+
50
+
```ts
51
+
import { Postgres } from 'podkeeper';
52
+
```
53
+
54
+
* Minio
55
+
56
+
```ts
57
+
import { Minio } from 'podkeeper';
58
+
```
59
+
60
+
If a popular service is missing, please do not hesitate to submit a pull request.
61
+
Alternatively, you can launch a generic container service with the `GenericService` class:
@@ -23,4 +99,4 @@ There are also some notable differences in API design philosophy:
23
99
24
100
- **Process Behavior**: PodKeeper services prevent the Node.js process from exiting, while TestContainers services do not.
25
101
- **Container Pulling**: PodKeeper does not implicitly pull containers, requiring them to be available beforehand, whereas TestContainers lazily pulls containers as needed when launching a service.
26
-
102
+
- **Healthchecks**: The services that PodKeeper ships out-of-the-box are pre-configured to use proper healthchecks.
0 commit comments