diff options
-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() |