diff --git a/bin/autobahn-router/Dockerfile b/bin/autobahn-router/Dockerfile index b671b3b..2469708 100644 --- a/bin/autobahn-router/Dockerfile +++ b/bin/autobahn-router/Dockerfile @@ -16,10 +16,11 @@ COPY . . RUN cargo build --release --bin autobahn-router FROM debian:bookworm-slim as run +ARG CONFIG_PATH=/app/bin/autobahn-router/template-config.toml RUN apt-get update && apt-get -y install ca-certificates libc6 libssl3 libssl-dev openssl COPY --from=build /app/target/release/autobahn-router /usr/local/bin/ -COPY --from=build /app/bin/autobahn-router/template-config.toml /usr/local/bin/template-config.toml +COPY --from=build $CONFIG_PATH /usr/local/bin/template-config.toml RUN adduser --system --group --no-create-home mangouser USER mangouser diff --git a/bin/autobahn-router/eclipse/Dockerfile b/bin/autobahn-router/eclipse/Dockerfile deleted file mode 100644 index e95f5ee..0000000 --- a/bin/autobahn-router/eclipse/Dockerfile +++ /dev/null @@ -1,25 +0,0 @@ -FROM rust:1.76.0 as base -RUN cargo install cargo-chef@0.1.62 --locked -RUN rustup component add rustfmt -RUN apt-get update && apt-get install -y clang cmake ssh -WORKDIR /app - -FROM base AS plan -COPY . . -WORKDIR /app -RUN cargo chef prepare --recipe-path recipe.json - -FROM base as build -COPY --from=plan /app/recipe.json recipe.json -RUN cargo chef cook --release --recipe-path recipe.json -COPY . . -RUN cargo build --release --bin autobahn-router - -FROM debian:bookworm-slim as run -RUN apt-get update && apt-get -y install ca-certificates libc6 libssl3 libssl-dev openssl - -COPY --from=build /app/target/release/autobahn-router /usr/local/bin/ -COPY --from=build /app/bin/autobahn-router/template-config-eclipse.toml /usr/local/bin/template-config.toml - -RUN adduser --system --group --no-create-home mangouser -USER mangouser diff --git a/bin/autobahn-router/src/template-config-eclipse.toml b/bin/autobahn-router/template-config-eclipse.toml similarity index 100% rename from bin/autobahn-router/src/template-config-eclipse.toml rename to bin/autobahn-router/template-config-eclipse.toml diff --git a/fly-eclipse.toml b/fly-eclipse.toml index 8abea39..765febc 100644 --- a/fly-eclipse.toml +++ b/fly-eclipse.toml @@ -4,13 +4,16 @@ kill_signal = "SIGTERM" kill_timeout = "30s" [build] - dockerfile = 'bin/autobahn-router/eclipse/Dockerfile' + dockerfile = 'bin/autobahn-router/Dockerfile' + +[build.args] + CONFIG_PATH="/app/bin/autobahn-router/template-config-eclipse.toml" [experimental] - cmd = ["autobahn-router", "/usr/local/bin/template-config-eclipse.toml"] + cmd = ["autobahn-router", "/usr/local/bin/template-config.toml"] [[vm]] - size = "shared-4x" + size = "shared-cpu-4x" memory = "8gb" [[restart]]