From a2337df39a42d769a0620361cbf9b8050380104c Mon Sep 17 00:00:00 2001 From: Jordan Doyle Date: Sat, 30 Oct 2021 18:48:00 +0100 Subject: [PATCH] Update Dockerfile instructions --- Dockerfile | 4 +--- book/src/getting-started/installation.md | 33 +++++++++++++++++++++++---------- 2 files changed, 22 insertions(+), 15 deletions(-) diff --git a/Dockerfile b/Dockerfile index 1da89a9..34e3522 100644 --- a/Dockerfile +++ a/Dockerfile @@ -1,15 +1,14 @@ FROM rust:alpine AS builder RUN apk add --update gcc g++ build-base alpine-sdk sqlite-dev openssl-dev postgresql-dev WORKDIR /app COPY . /app -RUN cargo build --release +RUN cargo build --release --features postgres FROM alpine AS chartered-git RUN apk add --update postgresql-dev && \ ln -s /lib/ld-musl-$(uname -m).so.1 /lib/ld-linux-$(uname -m).so.1 WORKDIR /app COPY --from=builder /app/target/release/chartered-git /app/chartered-git -ENV RUST_LOG=debug ENTRYPOINT ["/app/chartered-git"] FROM alpine AS chartered-web @@ -17,5 +16,4 @@ ln -s /lib/ld-musl-$(uname -m).so.1 /lib/ld-linux-$(uname -m).so.1 WORKDIR /app COPY --from=builder /app/target/release/chartered-web /app/chartered-web -ENV RUST_LOG=debug ENTRYPOINT ["/app/chartered-web"] diff --git a/book/src/getting-started/installation.md b/book/src/getting-started/installation.md index 02a4695..3f88b0d 100644 --- a/book/src/getting-started/installation.md +++ a/book/src/getting-started/installation.md @@ -27,15 +27,18 @@ Using the recommended setup, S3 & PostgreSQL: + +#### `chartered-web` config + ```toml -bind_address = "127.0.0.1:8080" # hint: use a different port for each service +bind_address = "127.0.0.1:8080" database_uri = "postgres://user:password@localhost/chartered" - -# the below configuration options should only be set for chartered-web storage_uri = "s3://s3-eu-west-1.amazonaws.com/my-cool-crate-store/" -frontend_url = "https://my.instance.chart.rs" # this is used for CORS - # if unset defaults to * +frontend_base_uri = "http://localhost:1234/" +[auth.password] +enabled = true + # openid connect provider [auth.gitlab] enabled = true @@ -44,13 +47,17 @@ client_secret = "[client-secret]" ``` -Or, using the defaults of `chartered-web` as an example: +#### `chartered-git` config ```toml -bind_address = "127.0.0.1:8899" -database_uri = "sqlite://chartered.db" - -storage_uri = "file:///tmp/chartered" +bind_address = "127.0.0.1:2233" +database_uri = "postgres://user:password@localhost/chartered" # can also be `sqlite://` +web_base_uri = "http://localhost:8888/" + +[committer] +name = "Chartered" +email = "noreply@chart.rs" +message = "Updated crates!" ``` These configuration files can be passed into each binary using the `-c` CLI argument. @@ -68,8 +75,8 @@ $ docker build https://github.com/w4/chartered.git#main \ --target chartered-git \ -t chartered-git:master -$ docker run -d chartered-web -$ docker run -d chartered-git +$ docker -v $PWD/web-config.toml:/config.toml run -d chartered-web --config /config.toml +$ docker -v $PWD/git-config.toml:/config.toml run -d chartered-git --config /config.toml ``` [gh-issue]: https://github.com/w4/chartered/issues @@ -91,5 +98,7 @@ $ curl http://127.0.0.1:8080 ... ``` + +Where `BASE_URL` points to the `chartered-web` instance. [sws]: https://github.com/joseluisq/static-web-server -- rgit 0.1.3