diff --git a/.gitmodules b/.gitmodules index aaa19b0..14a70d7 100644 --- a/.gitmodules +++ b/.gitmodules @@ -22,3 +22,6 @@ [submodule "twba.backup_config"] path = twba.backup_config url = git@github.com:OMGeeky/backup_config.git +[submodule "twba-code-receiver"] + path = twba-code-receiver + url = git@github.com:OMGeeky/twba.code-receiver.git diff --git a/general_run_config/.dockerignore b/general_run_config/.dockerignore new file mode 100644 index 0000000..eb5a316 --- /dev/null +++ b/general_run_config/.dockerignore @@ -0,0 +1 @@ +target diff --git a/general_run_config/.run/Dockerfile.run.xml b/general_run_config/.run/Dockerfile.run.xml new file mode 100644 index 0000000..025e7e6 --- /dev/null +++ b/general_run_config/.run/Dockerfile.run.xml @@ -0,0 +1,53 @@ + + + + + + + + + + + + diff --git a/general_run_config/Dockerfile b/general_run_config/Dockerfile new file mode 100644 index 0000000..a334c25 --- /dev/null +++ b/general_run_config/Dockerfile @@ -0,0 +1,45 @@ +FROM lukemathwalker/cargo-chef:latest-rust-1 AS chef +WORKDIR /app + +FROM chef AS planner +COPY /src ./src +COPY /Cargo.toml . +COPY /Cargo.lock . +RUN cargo chef prepare --recipe-path recipe.json + +FROM chef AS builder +COPY --from=planner /app/recipe.json recipe.json +# Build dependencies - this is the caching Docker layer! +RUN --mount=type=cache,target=/usr/local/cargo/registry \ + --mount=type=cache,target=/home/root/app/target \ + cargo chef cook --release --locked --recipe-path recipe.json +# Build application +COPY /src ./src +COPY /.cargo ./.cargo +COPY /Cargo.toml . +COPY /Cargo.lock . +RUN --mount=type=cache,target=/usr/local/cargo/registry \ + --mount=type=cache,target=/home/root/app/target \ + cargo build --release --locked + +# We do not need the Rust toolchain to run the binary! +FROM debian:bookworm AS runtime +WORKDIR /app +ARG PROGNAME +RUN apt-get update && apt-get install -y libssl-dev coreutils +# Create a script to run the command and sleep for one hour after the command is done +RUN echo "#!/bin/bash \n \ + echo \"Running command: '$PROGNAME'\" \n \ + # Run your command \n \ + $PROGNAME \n \ + echo \"Done with normal command. Sleeping for one hour\" \n \ + # Sleep for one hour \n \ + sleep 3600 \n \ + echo \"Done with sleep. Exiting\" \ + " > /app/entrypoint.sh + +# Make the script executable +RUN chmod +x /app/entrypoint.sh +COPY --from=builder /app/target/release/$PROGNAME /usr/local/bin/$PROGNAME + +CMD ["/app/entrypoint.sh"] diff --git a/twba-code-receiver b/twba-code-receiver new file mode 160000 index 0000000..e979cc1 --- /dev/null +++ b/twba-code-receiver @@ -0,0 +1 @@ +Subproject commit e979cc13f29d84e4b5d9013a8873da28dfc30f10 diff --git a/twba.backup_config b/twba.backup_config index 8864594..87a67bd 160000 --- a/twba.backup_config +++ b/twba.backup_config @@ -1 +1 @@ -Subproject commit 88645945830d3076478827503fef43541a2f047e +Subproject commit 87a67bd757c0e1757ae1c612645a0cf534f0703a diff --git a/twba.uploader b/twba.uploader index 23f9745..3b72550 160000 --- a/twba.uploader +++ b/twba.uploader @@ -1 +1 @@ -Subproject commit 23f974525ec02e75d8fcc57fe06fb3d6a153afeb +Subproject commit 3b7255096228855938032e276a3d336320cc69b8 diff --git a/twitch_data b/twitch_data index 908cbae..64635be 160000 --- a/twitch_data +++ b/twitch_data @@ -1 +1 @@ -Subproject commit 908cbae28ff0c7b13e00a942955776c1c0e14707 +Subproject commit 64635bef670e4feb6ca423d0da286db52e687965