Skip to content

Commit a2337df

Browse files
committed
Update Dockerfile instructions
1 parent 5fd9217 commit a2337df

File tree

2 files changed

+22
-15
lines changed

2 files changed

+22
-15
lines changed

Dockerfile

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,18 @@ FROM rust:alpine AS builder
22
RUN apk add --update gcc g++ build-base alpine-sdk sqlite-dev openssl-dev postgresql-dev
33
WORKDIR /app
44
COPY . /app
5-
RUN cargo build --release
5+
RUN cargo build --release --features postgres
66

77
FROM alpine AS chartered-git
88
RUN apk add --update postgresql-dev && \
99
ln -s /lib/ld-musl-$(uname -m).so.1 /lib/ld-linux-$(uname -m).so.1
1010
WORKDIR /app
1111
COPY --from=builder /app/target/release/chartered-git /app/chartered-git
12-
ENV RUST_LOG=debug
1312
ENTRYPOINT ["/app/chartered-git"]
1413

1514
FROM alpine AS chartered-web
1615
RUN apk add --update postgresql-dev && \
1716
ln -s /lib/ld-musl-$(uname -m).so.1 /lib/ld-linux-$(uname -m).so.1
1817
WORKDIR /app
1918
COPY --from=builder /app/target/release/chartered-web /app/chartered-web
20-
ENV RUST_LOG=debug
2119
ENTRYPOINT ["/app/chartered-web"]

book/src/getting-started/installation.md

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,17 @@ and store crate files in `/tmp/chartered`, configuration away from these default
2727

2828
Using the recommended setup, S3 & PostgreSQL:
2929

30+
31+
#### `chartered-web` config
32+
3033
```toml
31-
bind_address = "127.0.0.1:8080" # hint: use a different port for each service
34+
bind_address = "127.0.0.1:8080"
3235
database_uri = "postgres://user:password@localhost/chartered"
33-
34-
# the below configuration options should only be set for chartered-web
3536
storage_uri = "s3://s3-eu-west-1.amazonaws.com/my-cool-crate-store/"
36-
frontend_url = "https://my.instance.chart.rs" # this is used for CORS
37-
# if unset defaults to *
37+
frontend_base_uri = "http://localhost:1234/"
38+
39+
[auth.password]
40+
enabled = true
3841

3942
# openid connect provider
4043
[auth.gitlab]
@@ -44,13 +47,17 @@ client_id = "[client-id]"
4447
client_secret = "[client-secret]"
4548
```
4649

47-
Or, using the defaults of `chartered-web` as an example:
50+
#### `chartered-git` config
4851

4952
```toml
50-
bind_address = "127.0.0.1:8899"
51-
database_uri = "sqlite://chartered.db"
52-
53-
storage_uri = "file:///tmp/chartered"
53+
bind_address = "127.0.0.1:2233"
54+
database_uri = "postgres://user:password@localhost/chartered" # can also be `sqlite://`
55+
web_base_uri = "http://localhost:8888/"
56+
57+
[committer]
58+
name = "Chartered"
59+
60+
message = "Updated crates!"
5461
```
5562

5663
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 \
6875
$ docker build https://github.com/w4/chartered.git#main \
6976
--target chartered-git \
7077
-t chartered-git:master
71-
$ docker run -d chartered-web
72-
$ docker run -d chartered-git
78+
$ docker -v $PWD/web-config.toml:/config.toml run -d chartered-web --config /config.toml
79+
$ docker -v $PWD/git-config.toml:/config.toml run -d chartered-git --config /config.toml
7380
```
7481

7582
[gh-issue]: https://github.com/w4/chartered/issues
@@ -92,4 +99,6 @@ $ curl http://127.0.0.1:8080
9299
<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8">...
93100
```
94101

102+
Where `BASE_URL` points to the `chartered-web` instance.
103+
95104
[sws]: https://github.com/joseluisq/static-web-server

0 commit comments

Comments
 (0)