An open API service indexing awesome lists of open source software.

https://github.com/meierschlumpf/docker-api

A small web app with three docker endpoints to start, stop and restart docker containers by id
https://github.com/meierschlumpf/docker-api

Last synced: 7 months ago
JSON representation

A small web app with three docker endpoints to start, stop and restart docker containers by id

Awesome Lists containing this project

README

          

# Docker API

This application is a simple API that allows you to manage docker containers.

## Getting Started

To get started you need to run the following commands:

```bash
$ git clone https://github.com/Meierschlumpf/docker-api.git
$ cd docker-api
$ yarn install
$ yarn dev
```

## API

The API exposes the following endpoints:

### POST /api/containers/[id]/start

Starts a container.

### POST /api/containers/[id]/stop

Stops a container.

### POST /api/containers/[id]/restart

Restarts a container.

## Environment Variables

The following environment variables are required to run the application:

```env
DOCKER_HOST=
DOCKER_PORT=
```

You can simply create a `.env` file in the root directory of the project and add the variables there.