Skip to content

Commit a607ddb

Browse files
committed
2 parents 68428f5 + 6be5470 commit a607ddb

File tree

3 files changed

+19
-6
lines changed

3 files changed

+19
-6
lines changed

Dockerfile

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,23 @@
11
# ============ Build Stage ============
2-
FROM rust:1.74-bookworm as build
3-
2+
FROM lukemathwalker/cargo-chef:latest-rust-1 AS chef
43
WORKDIR /typst-bot
54

5+
FROM chef AS planner
6+
67
# Compilation requires only the source code.
78
COPY Cargo.toml Cargo.lock ./
89
COPY crates crates
10+
RUN cargo chef prepare --recipe-path recipe.json
911

10-
RUN cargo build --release --all --config git-fetch-with-cli=true
12+
FROM chef AS builder
1113

14+
COPY --from=planner /typst-bot/recipe.json recipe.json
15+
# Caching layer
16+
RUN cargo chef cook --release --workspace --recipe-path recipe.json
17+
# Compilation requires only the source code.
18+
COPY Cargo.toml Cargo.lock ./
19+
COPY crates crates
20+
RUN cargo build --release --workspace --config git-fetch-with-cli=true
1221

1322
# ============ Run Stage ============
1423
FROM debian:bookworm-slim as run
@@ -26,11 +35,12 @@ RUN mkdir -p /bot/sqlite /bot/cache && \
2635
touch /bot/sqlite/db.sqlite
2736

2837
# The only files we need from the build stage in order to run the bot are the two executables.
29-
COPY --from=build \
38+
COPY --from=builder \
3039
/typst-bot/target/release/worker \
3140
/typst-bot/target/release/typst-bot \
3241
./
3342

3443
# Fonts are copied from the host at the very end so that the fonts can get updated without
3544
# invalidating any previously cached image layers.
3645
COPY fonts fonts
46+

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ and start the container with `docker compose up -d`.
3838

3939
Here is a link you can use to invite a public instance run by [@frozolotl](https://github.com/frozolotl): https://discord.com/oauth2/authorize?client_id=1183804211264225301&permissions=3072&scope=bot
4040

41+
Note: the bot may be limited from joining more servers because we require the message content (since slash commands don't support code blocks) and Discord denied verification, so we are limited to 100 servers. Accordingly, we request that you remove the bot from your servers if you are not using it anymore.
42+
4143
## License
4244

4345
AGPL. Use `?source` to get a link to the source from deployments of the bot.

crates/worker/Cargo.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@ protocol = { path = "../protocol" }
1313
thiserror = "1"
1414
time = "0.3"
1515
ttf-parser = "0.21"
16-
typst = "0.11"
17-
typst-render = "0.11"
16+
typst = "0.12"
17+
typst-assets = { version = "0.12", features = ["fonts"] }
18+
typst-render = "0.12"
1819

1920
# downloading packages
2021
zune-inflate = { version = "0.2", default-features = false, features = [

0 commit comments

Comments
 (0)