This repository consists of 4 docker-compose services:
- Nginx web server
- NodeJS app server
- AdminMongoDB server
- MongoDB server
- Docker 18.06.0+
- Docker composer
- Node
- NPM
- Suggested OS: Linux/Mac
- Clone repository:
$ git clone https://github.com/dansali/DockerComposeChallenge.git
- Start container instances:
$ docker-compose up -d
- If first time starting, wait 20 seconds and execute (more info below):
$ docker-compose restart mongodbadmin
-
Visit application: http://localhost:8080 Raw data: http://localhost:8080/data
-
Visit mongodb admin panel: http://localhost:8081
-
Start containers:
$ docker-compose up
-
Stop containers:
$ docker-compose down
-
Remove containers data:
$ docker-compose rm && docker volume rm dockercomposechallenge_data-volume
First startup of the docker containers will result in adminMongo connecting too soon. MongoDB restarts after the first initialisation, this affects the depends-on feature in the composer.
You may need to run:
$ docker-compose restart mongodbadmin
- Docker version 19.03.4, build 9013bf5
- docker-compose version 1.24.1, build 4667896b
- NodeJS (Dependencies: express and mongodb)
- Nginx, MongoDB, AdminMongoDB