Skip to content

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

Notifications You must be signed in to change notification settings

luciangutu/rust_mongo_http_PoC

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

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

About

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

Topics

Resources

Stars

Watchers

Forks