diff --git a/Dockerfile b/Dockerfile index e90a2e5d..5eef497f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,23 +1,18 @@ -FROM lukemathwalker/cargo-chef as planner +FROM lukemathwalker/cargo-chef:latest-rust-1.56.1 AS chef WORKDIR app -COPY . . -RUN cargo chef prepare --recipe-path recipe.json -FROM lukemathwalker/cargo-chef as cacher -WORKDIR app +FROM chef AS planner +COPY . . +RUN cargo chef prepare --recipe-path recipe.json + +FROM chef AS builder COPY --from=planner /app/recipe.json recipe.json RUN cargo chef cook --release --recipe-path recipe.json -FROM rust as builder -WORKDIR app COPY . . -# Copy over the cached dependencies -COPY --from=cacher /app/target target -COPY --from=cacher $CARGO_HOME $CARGO_HOME RUN cargo build --release --bin atuin -FROM debian:buster-slim as runtime - +FROM debian:bullseye-20211011-slim AS runtime WORKDIR app ENV TZ=Etc/UTC diff --git a/docs/server.md b/docs/server.md index 445aacdd..650934b5 100644 --- a/docs/server.md +++ b/docs/server.md @@ -19,19 +19,50 @@ OPTIONS: -p, --port ``` +## Configuration + The config for the server is kept separate from the config for the client, even though they are the same binary. Server config can be found at `~/.config/atuin/server.toml`. It looks something like this: -``` +```toml host = "0.0.0.0" port = 8888 open_registration = true db_uri="postgres://user:password@hostname/database" ``` -`open_registration` sets whether the server allows new user registrations. Set -this to false after making your own account if you don't want others to be able -to use your server. +Alternatively, configuration can also be provided with environment variables. + +```sh +ATUIN_HOST="0.0.0.0" +ATUIN_PORT=8888 +ATUIN_OPEN_REGISTRATION=true +ATUIN_DB_URI="postgres://user:password@hostname/database" +``` + +### host + +The host address the atuin server should listen on. + +Defaults to `127.0.0.1`. + +### port + +The post the atuin server should listen on. + +Defaults to `8888`. + +### open_registration + +If `true`, atuin will accept new user registrations. +Set this to `false` after making your own account if you don't want others to be +able to use your server. + +Defaults to `false`. + +### db_uri + +A valid postgres URI, where the user and history data will be saved to.