Build dockerfiles for chartered-web & chartered-git
Diff
Dockerfile | 21 +++++++++++++++++++++
book/src/getting-started/installation.md | 16 ++++++++++++++--
2 files changed, 31 insertions(+), 6 deletions(-)
@@ -1,0 +1,21 @@
FROM rust:alpine AS builder
RUN apk add --update gcc g++ build-base alpine-sdk sqlite-dev
WORKDIR /app
COPY . /app
RUN cargo build --release
FROM alpine AS chartered-git
RUN apk add --update sqlite sqlite-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=info
ENTRYPOINT ["/app/chartered-git"]
FROM alpine AS chartered-web
RUN apk add --update sqlite sqlite-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-web /app/chartered-web
ENV RUST_LOG=info
ENTRYPOINT ["/app/chartered-web"]
@@ -27,19 +27,21 @@
Using the recommended setup, S3 & PostgreSQL:
```toml
bind-address = "127.0.0.1:8080"
bind-address = "127.0.0.1:8080" # hint: use a different port for each service
database-uri = "postgres://user:password@localhost/chartered"
# unlike the above two options, this configuration value should only be supplied
# for chartered-web
# the below configuration options should only be set for chartered-web
crate-store = "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 *
```
Or, using the defaults as an example:
Or, using the defaults of `chartered-web` as an example:
```toml
bind-address = "127.0.0.1:8899"
database-uri = "sqlite://chartered.db"
crate-store = "file:///tmp/chartered"
```
@@ -58,8 +60,10 @@
to run on your own server without another way of hosting static content:
```sh
$ DOCKER_BUILDKIT=0 docker build https://github.com/w4/chartered.git#main:chartered-frontend \
--build-arg BASE_URL=https://my.instance.chart.rs -t chartered-frontend:master
$ DOCKER_BUILDKIT=0 docker build \
https://github.com/w4/chartered.git#main:chartered-frontend \
--build-arg BASE_URL=https://api.my.instance.chart.rs \
-t chartered-frontend:master
$ docker run -p 8080:80 chartered-frontend:master
$ curl http://127.0.0.1:8080
<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8">...