diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..ea099217 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,17 @@ +FROM rust:1.71 AS builder +COPY Cargo.toml Cargo.lock gh-private-key.pem ./ +COPY ./http-server ./http-server +COPY ./database ./database +COPY ./lib ./lib +COPY ./fplus ./fplus + +# Change workdir to http-server and then build +WORKDIR ./http-server +RUN cargo build --release + +FROM debian:bullseye + +# Needed for openssl(hyper uses it) +RUN apt-get update && apt-get install -y libssl-dev ca-certificates && rm -rf /var/lib/apt/lists/* +COPY --from=builder ./http-server/target/release/http-server ./target/release/http-server +CMD ["/target/release/http-server"] diff --git a/http-server/gh-private-key.pem b/gh-private-key.pem similarity index 100% rename from http-server/gh-private-key.pem rename to gh-private-key.pem diff --git a/http-server/Dockerfile b/http-server/Dockerfile deleted file mode 100644 index 56bef440..00000000 --- a/http-server/Dockerfile +++ /dev/null @@ -1,11 +0,0 @@ -FROM rust:1.71 AS builder -COPY Cargo.toml Cargo.lock gh-private-key.pem ./ -COPY ./src ./src -RUN cargo build --release - -FROM debian:bullseye - -# Needed for openssl(hyper uses it) -RUN apt-get update && apt-get install -y libssl-dev ca-certificates && rm -rf /var/lib/apt/lists/* -COPY --from=builder ./target/release/http-server ./target/release/http-server -CMD ["/target/release/http-server"] \ No newline at end of file diff --git a/lib/gh-private-key.pem b/lib/gh-private-key.pem deleted file mode 100644 index 45722a30..00000000 --- a/lib/gh-private-key.pem +++ /dev/null @@ -1,28 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIIEpAIBAAKCAQEAv9hBfOdLDLDMvD1b7ee2yK94QKildsrl4f/SjKLLxnTCoj6j -7oAvmdFoxVAvH/uxMczlOT2GibN5Qz6Eo75mBXbKaOtONWmEW6qD9QJ+d9x4p7ya -a71hiLYjD9BpocVhgcF7h98mrdPfAeYef3azJW5/+u7BVJiZ/yA9GpKA+MlhqRbB -39o+GoxJXNzKkr7zTjwkGM9O8WuT2dQybLH7B2aBAHzFKWC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h+ss00iX4zaz22DPkawmc3BlB5/gFsnVJ4jPfeRJ96XZKgIR -sEEjjWCCEeZ4UuLTr98Pt5zwkRuxwAxcPRI4Hf2pCoT1/aLFo1iouL9ZUxdclOkx -gMdqsQKBgQC04ZkN/qq85Wrd4KKnWRkNEXCnPTr7dADhRVJDGiXs+5kbzU1vXjcC -pVq42rniKcpZ5uCsIISmE9LXMiMD/lhaTz9Oksk0CYjO7+NWlgwB8XZJaabLeMoV -9gxYoslGn/vUS1ZRRL3LQJnO34YaI6yFzbLxcXpICFTKsxoz3B3ygw== ------END RSA PRIVATE KEY----- - diff --git a/lib/src/external_services/github.rs b/lib/src/external_services/github.rs index 01793983..81086b12 100644 --- a/lib/src/external_services/github.rs +++ b/lib/src/external_services/github.rs @@ -73,7 +73,7 @@ impl GithubWrapper<'static> { .pool_idle_timeout(std::time::Duration::from_secs(15)) .build(connector); let key = - jsonwebtoken::EncodingKey::from_rsa_pem(include_bytes!("../../gh-private-key.pem")) + jsonwebtoken::EncodingKey::from_rsa_pem(include_bytes!("../../../gh-private-key.pem")) .unwrap(); let octocrab = OctocrabBuilder::new_empty() .with_service(client)