Skip to content

Commit

Permalink
🐳 Fix Docker image not having CA certificates
Browse files Browse the repository at this point in the history
  • Loading branch information
Steffo99 committed Mar 29, 2022
1 parent 5c81af6 commit ec77cd6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ FROM source AS install
RUN cargo install --path .

FROM debian:buster AS app
RUN apt-get update && apt-get install -y libssl1.1 && rm -rf /var/lib/apt/lists/*
RUN apt-get update
RUN apt-get install -y libssl1.1 ca-certificates
RUN rm -rf /var/lib/apt/lists/*
COPY --from=install /usr/local/cargo/bin/revenants_brooch /usr/local/bin/revenants_brooch
CMD ["revenants_brooch"]
10 changes: 8 additions & 2 deletions src/stratz.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,15 @@ pub async fn fetch_matches(client: reqwest::Client, guild_id: i64, take: i64) ->
trace!("Building query...");
let body = MatchesQuery::build_query(vars);
trace!("Posting request...");
let resp = client.post(api_url()).json(&body).send().await.map_err(|_| StratzError::Request)?;
let resp = client.post(api_url()).json(&body).send().await.map_err(|err| {
error!("Error while performing request: {:#?}", &err);
StratzError::Request
})?;
trace!("Parsing response...");
let data = resp.json::<Response>().await.map_err(|_| StratzError::Parse)?;
let data = resp.json::<Response>().await.map_err(|err| {
error!("Error while parsing response: {:#?}", &err);
StratzError::Parse
})?;
trace!("Successfully parsed response!");

Ok(data)
Expand Down

0 comments on commit ec77cd6

Please sign in to comment.