-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Get docker working, fix clippy, use stdout for logging and fix crash …
…if api takes too long to respond
- Loading branch information
Showing
6 changed files
with
118 additions
and
104 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
Dockerfile | ||
.dockerignore | ||
node_modules | ||
README.md | ||
target | ||
log | ||
*.md | ||
docker | ||
.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,45 @@ | ||
FROM rust:1.76 as builder | ||
#FROM rust:1.76-alpine as builder | ||
# | ||
#WORKDIR /usr/src/verify-bot | ||
#COPY . . | ||
# | ||
#RUN apk update && apk install libssl-dev && rm -rf /var/lib/apt/lists/* | ||
# | ||
#RUN cargo install --path . | ||
# | ||
#CMD ["verify-bot"] | ||
|
||
WORKDIR /usr/src/verify-vbot | ||
COPY . . | ||
FROM rust:1.76-buster as build | ||
|
||
# create a new empty shell project | ||
RUN USER=root cargo new --bin verify-bot | ||
WORKDIR /verify-bot | ||
|
||
# copy over your manifests | ||
COPY ./Cargo.lock ./Cargo.lock | ||
COPY ./Cargo.toml ./Cargo.toml | ||
|
||
# this build step will cache your dependencies | ||
RUN cargo build --release | ||
RUN rm src/*.rs | ||
|
||
# copy your source tree | ||
COPY ./src ./src | ||
COPY ./log4rs.yml ./log4rs.yml | ||
|
||
# build for release | ||
RUN rm ./target/release/deps/verify_bot* | ||
RUN cargo build --release | ||
|
||
# our final base | ||
FROM debian:buster | ||
|
||
RUN apt-get update && apt-get -y install libssl1.1 && apt clean && rm -rf /var/lib/apt/lists/* | ||
|
||
# copy the build artifact from the build stage | ||
COPY --from=build /verify-bot/target/release/verify-bot . | ||
|
||
# set the startup command to run your binary | ||
CMD ["./verify-bot"] | ||
|
||
RUN cargo install --path . | ||
|
||
CMD ["verify-bot"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,11 @@ | ||
refresh_rate: 30 seconds | ||
|
||
appenders: | ||
file: | ||
kind: rolling_file | ||
path: log/verify.log | ||
stdout: | ||
kind: console | ||
|
||
append: true | ||
|
||
encoder: | ||
kind: pattern | ||
|
||
policy: | ||
kind: compound | ||
|
||
trigger: | ||
kind: size | ||
limit: 10 mb | ||
|
||
roller: | ||
kind: delete | ||
|
||
root: | ||
level: warn | ||
appenders: | ||
- file | ||
- stdout |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters