> For the complete documentation index, see [llms.txt](https://fredericheem.gitbook.io/starhackit/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://fredericheem.gitbook.io/starhackit/backend/dockercompose.md).

# Development Enviromnent with docker-compose

*docker-compose* manages the docker containers for the various services such as Redis and Postgres on the local machine.

The file [docker-compose.yml](https://github.com/FredericHeem/starhackit/tree/134e7fd3f5e3c90fbd8af58467001b5f2ee155f9/server/docker-compose.yml) defines all dependencies to run the project

```
# cd server
# npm run docker:up
```

To check that the containers are running:

```
# docker ps
CONTAINER ID        IMAGE                     COMMAND                  CREATED             STATUS              PORTS                    NAMES
e16e6b12b427        postgres:10-alpine        "docker-entrypoint.s…"   47 hours ago        Up 47 hours         0.0.0.0:6432->5432/tcp   server_pg_1
0b24afd9defe        smebberson/alpine-redis   "/init"                  47 hours ago        Up 47 hours         0.0.0.0:7379->6379/tcp   server_redis_1
```

Getting a container logs:

```
$ docker logs server_pg_1
```

Destroy all containers and volumes:

```
$ npm run docker:destroy
```
