Skip to content

Latest commit

 

History

History
46 lines (37 loc) · 1.03 KB

README.md

File metadata and controls

46 lines (37 loc) · 1.03 KB

rust_mongo_http_PoC

Containerized Rust app that returns all Mongo's databases as a HTTP service

How to run

$ COMPOSE_DOCKER_CLI_BUILD=1 DOCKER_BUILDKIT=1 docker-compose up -d --build

Test that is working

$ curl http://localhost:8080
Databases:
- admin
- config
- local

Details

Rust code is in main.rc file.
The HTTP service is listening on TCP 8080, on 0.0.0.0.
Rust is getting the Mongo URI from the MONGODB_URI environment variable, placed in .env

The containers are deployed using docker-compose with BuildKit, using multi-stage builds for Rust. See Dockerfile

Troubeshooting

Check that the containers are up & running:

$ docker-compose ps

Testing the mongo connection after running the docker-compose up command from "How to run":

$ mongo 127.0.0.1:27017

Connect to one of the containers:

$ docker exec -ti mongo /bin/bash

Cleanup

$ docker-compose stop
$ docker-compose rm