diff options
author | FxQnLr <[email protected]> | 2024-02-12 15:50:58 +0100 |
---|---|---|
committer | FxQnLr <[email protected]> | 2024-02-12 15:50:58 +0100 |
commit | c9034a7276dbdf87649c9946ef5072de58097259 (patch) | |
tree | 9695c326bdb5501a0ea6e51d0827292d4ef8cf50 | |
parent | ca395b81bcadb9dde9214098f2cab0c7a3561574 (diff) | |
download | webol-c9034a7276dbdf87649c9946ef5072de58097259.tar webol-c9034a7276dbdf87649c9946ef5072de58097259.tar.gz webol-c9034a7276dbdf87649c9946ef5072de58097259.zip |
remove cargo chef
-rw-r--r-- | Dockerfile | 15 | ||||
-rw-r--r-- | src/config.rs | 2 |
2 files changed, 5 insertions, 12 deletions
@@ -5,22 +5,15 @@ RUN cd /tmp && \ | |||
5 | mkdir /dpkg && \ | 5 | mkdir /dpkg && \ |
6 | for deb in *.deb; do dpkg --extract $deb /dpkg || exit 10; done | 6 | for deb in *.deb; do dpkg --extract $deb /dpkg || exit 10; done |
7 | 7 | ||
8 | FROM lukemathwalker/cargo-chef:latest-rust-1.73.0 as chef | 8 | FROM rust:1.76 as builder |
9 | WORKDIR app | 9 | WORKDIR /app |
10 | |||
11 | FROM chef AS planner | ||
12 | COPY . . | 10 | COPY . . |
13 | RUN cargo chef prepare --recipe-path recipe.json | 11 | RUN SQLX_OFFLINE=true cargo install --path . |
14 | 12 | ||
15 | FROM chef as builder | ||
16 | COPY --from=planner /app/recipe.json recipe.json | ||
17 | RUN cargo chef cook --release --recipe-path recipe.json | ||
18 | COPY . . | ||
19 | RUN cargo build --release | ||
20 | 13 | ||
21 | FROM gcr.io/distroless/cc | 14 | FROM gcr.io/distroless/cc |
22 | COPY --from=builder /app/target/release/webol / | 15 | COPY --from=builder /app/target/release/webol / |
23 | COPY --from=deb_extractor /dpkg / | 16 | COPY --from=deb_extractor /dpkg / |
24 | 17 | ||
25 | EXPOSE 7229 | 18 | EXPOSE 7229 |
26 | ENTRYPOINT ["./webol"] \ No newline at end of file | 19 | ENTRYPOINT ["./webol"] |
diff --git a/src/config.rs b/src/config.rs index e88ddab..4319ffc 100644 --- a/src/config.rs +++ b/src/config.rs | |||
@@ -16,7 +16,7 @@ impl Config { | |||
16 | .set_default("pingtimeout", 10)? | 16 | .set_default("pingtimeout", 10)? |
17 | .add_source(File::with_name("config.toml").required(false)) | 17 | .add_source(File::with_name("config.toml").required(false)) |
18 | .add_source(File::with_name("config.dev.toml").required(false)) | 18 | .add_source(File::with_name("config.dev.toml").required(false)) |
19 | .add_source(config::Environment::with_prefix("WEBOL").separator("_")) | 19 | .add_source(config::Environment::with_prefix("WEBOL").prefix_separator("_")) |
20 | .build()?; | 20 | .build()?; |
21 | 21 | ||
22 | config.try_deserialize() | 22 | config.try_deserialize() |