Rust Dockerized API Example

For development

Directly

cargo run -- -p 3000
curl http://localhost:3000

With Watcher

cargo install cargo-watch
cargo watch -x "run -- p 3000"
curl http://localhost:3000

Docker Compose

docker-compose -d up

Running a production like version

docker-compose -f docker-compose-prod.yaml up --build

Build production image

docker build -t rust_dockerized_api --target release .