-
-
Notifications
You must be signed in to change notification settings - Fork 203
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
56 changed files
with
4,020 additions
and
1,382 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Contributing | ||
|
||
[Create an issue](https://github.com/testcontainers/testcontainers-node/issues) if you find any bugs. | ||
|
||
[Create a pull request](https://github.com/testcontainers/testcontainers-node/pulls) if you wish to fix an issue or provide an enhancement. Please be sure to: | ||
* Discuss with the authors via an issue or discussion prior to doing anything big. | ||
* Follow the style, structure and naming conventions of the rest of the project. | ||
* Make commits atomic and easy to merge. | ||
* Run the Git hooks when making commits to ensure the code is linted and correctly formatted. | ||
* Verify all tests are passing with `npm test`. | ||
|
||
## Documentation | ||
|
||
The documentation is a static site built with [MkDocs](https://www.mkdocs.org/) and the [Material for MkDocs](https://squidfunk.github.io/mkdocs-material/) theme. In addition, we use a [custom plugin](https://github.com/rnorth/mkdocs-codeinclude-plugin) for inclusion of code snippets. We publish our documentation using Netlify. | ||
|
||
### Previewing rendered content | ||
|
||
#### Using Docker | ||
|
||
The root of the project contains a `docker-compose.yml` file. Simply run `docker-compose up` and then access the docs at [http://localhost:8000](http://localhost:8000). | ||
|
||
#### Using Python | ||
|
||
* Ensure that you have Python 3.8.0 or higher. | ||
* Set up a virtualenv and run `pip install -r requirements.txt` in the `testcontainers-node` root directory. | ||
* Once Python dependencies have been installed, run `mkdocs serve` to start a local auto-updating MkDocs server. | ||
|
||
#### PR Preview deployments | ||
|
||
Documentation for pull requests will automatically be published by Netlify as 'deploy previews'. These deployment previews can be accessed via the `deploy/netlify` check that appears for each pull request. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# Advanced | ||
|
||
## Container Runtime Client | ||
|
||
Testcontainers configures an underlying container runtime to perform its tasks. This runtime works automatically with several providers like Docker, Podman, Colima, Rancher Desktop and Testcontainers Desktop. There are too many usage examples to list here, but here are some common examples: | ||
|
||
### Fetch container runtime information | ||
|
||
```js | ||
import { getContainerRuntimeClient } from "testcontainers"; | ||
|
||
const containerRuntimeClient = await getContainerRuntimeClient(); | ||
|
||
console.log(containerRuntimeClient.info); | ||
``` | ||
|
||
### Pulling an image | ||
|
||
```js | ||
import { ImageName } from "testcontainers"; | ||
|
||
await containerRuntimeClient.image.pull(ImageName.fromString("alpine:3.12")) | ||
``` | ||
|
||
### Starting a container | ||
|
||
```js | ||
const container = await containerRuntimeClient.container.create({ ... }); | ||
await containerRuntimeClient.container.start(container); | ||
``` | ||
|
||
### Starting a Docker Compose environment | ||
|
||
```js | ||
const environment = await containerRuntimeClient.compose.up({ ... }) | ||
``` | ||
|
||
### Starting a network | ||
|
||
```js | ||
const network = await containerRuntimeClient.network.create({ ... }) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Localstack Module | ||
|
||
[Localstack](https://www.localstack.cloud/): Develop and test your AWS applications locally to reduce development time and increase product velocity | ||
|
||
## Install | ||
|
||
```bash | ||
npm install @testcontainers/localstack --save-dev | ||
``` | ||
|
||
## Examples | ||
|
||
<!--codeinclude--> | ||
[Create a S3 bucket:](../../packages/modules/localstack/src/localstack-container.test.ts) inside_block:createS3Bucket | ||
<!--/codeinclude--> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# Redis Module | ||
|
||
[Redis](https://redis.io/) The open source, in-memory data store used by millions of developers as a database, cache, streaming engine, and message broker. | ||
|
||
## Install | ||
|
||
```bash | ||
npm install @testcontainers/redis --save-dev | ||
``` | ||
|
||
## Examples | ||
|
||
<!--codeinclude--> | ||
[Start container:](../../packages/modules/redis/src/redis-container.test.ts) inside_block:startContainer | ||
<!--/codeinclude--> | ||
|
||
<!--codeinclude--> | ||
[Connect redis client to container:](../../packages/modules/redis/src/redis-container.test.ts) inside_block:simpleConnect | ||
<!--/codeinclude--> | ||
|
||
<!--codeinclude--> | ||
[Start container with password authentication:](../../packages/modules/redis/src/redis-container.test.ts) inside_block:startWithCredentials | ||
<!--/codeinclude--> | ||
|
||
<!--codeinclude--> | ||
[Define volume for persistent/predefined data:](../../packages/modules/redis/src/redis-container.test.ts) inside_block:persistentData | ||
<!--/codeinclude--> | ||
|
||
<!--codeinclude--> | ||
[Execute a command inside the container:](../../packages/modules/redis/src/redis-container.test.ts) inside_block:executeCommand | ||
<!--/codeinclude--> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.