Install rustup:
curl https://sh.rustup.rs -sSf | sh
To use an old version of Rust:
rustup toolchain install 1.36.0
rustup toolchain default 1.36.0
Useful commands:
rustup show
# Fast build & run
cargo run
# Debug binary (fast)
cargo build
./target/debug/interview
# Properly optimized release build (slow)
cargo build --release
./target/release/interview
To deal with dependencies independently of the app,
# Pull dependencies (but do not build them)
cargo fetch
# Or,
# Install cargo extension for independent building of deps
cargo install cargo-build-deps
# Then
RUN cargo build-deps
RUN cargo build
# Or,
RUN cargo build-deps --release
RUN cargo build --release
The config.yaml
file contains much of the application config. Some other configurations
are passed as the following environment variables:
REGION
, the region in which we're running our app, defaults tolocal
ENVIRONMENT
, the named environment our application runs in, defaults todevelopment
CONFIG_FILE
, location of the main app config file to load. Defaults toconfig.yaml
.REDIS_SECRETS_FILE
, location of a "secrets" file for Redis. Defaults toredis.yaml
.STARTUP_WAIT_MILLIS
, amount of time to wait before the app begins serving traffic. Defaults to30000
.
There are secrets in redis.yaml
, which should be overwritten but not committed. This can
lead into discussions about secrets management.