Rust Development Environment
Rust toolchain with cargo-watch live reloading + Postgres + Redis. Volume-mounted source for fast recompile cycles.
Rust Development Environment
A full Rust development stack without the setup tax. cargo-watch monitors your source for changes and triggers recompiles automatically, while Postgres and Redis are ready to connect from your first line of code.
What's Included
- Rust (stable, latest) with cargo-watch for live reloading on file changes
- Postgres 16 for persistent storage
- Redis 7 for caching and session state
- Volume-mounted
./src— edit on your host, recompile in the container - Cargo registry cache volume to avoid re-downloading crates on restart
Developer Experience
cargo-watch -x runstarts on container up — no extra command needed- Source directory mounted at
/appinside the container for accurate error paths - Cargo home cached in a named volume — dependencies survive
docker compose down - Environment variables for
DATABASE_URLandREDIS_URLpre-set for sqlx and deadpool-redis
What You Get
docker-compose.yml— all three services with dependency orderingDockerfile— multi-stage: dev stage for fast iteration, release stage for production buildssrc/main.rs— minimal starter that connects to Postgres and Redis on startupCargo.toml— pre-seeded with tokio, sqlx, redis, and dotenvy.env.example,.gitignore,README.md
Service URLs
- App:
http://localhost:8080 - Postgres:
localhost:5432 - Redis:
localhost:6379