mirror of
https://github.com/Noratrieb/widetom.git
synced 2026-01-14 08:55:02 +01:00
dockerized
This commit is contained in:
parent
7f24e86abf
commit
490c94ca50
2 changed files with 34 additions and 0 deletions
30
Dockerfile
Normal file
30
Dockerfile
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
FROM rust as build
|
||||
|
||||
RUN rustup toolchain install nightly
|
||||
RUN rustup default nightly
|
||||
RUN rustup target add x86_64-unknown-linux-musl
|
||||
|
||||
RUN apt-get update
|
||||
RUN apt-get install musl-tools -y
|
||||
|
||||
WORKDIR /app
|
||||
COPY Cargo.toml Cargo.lock ./
|
||||
RUN mkdir src
|
||||
RUN echo "fn main() {}" > src/main.rs
|
||||
|
||||
RUN cargo build --release -Zsparse-registry --target x86_64-unknown-linux-musl
|
||||
|
||||
COPY src ./src
|
||||
|
||||
# now rebuild with the proper main
|
||||
RUN touch src/main.rs
|
||||
RUN cargo build --release -Zsparse-registry --target x86_64-unknown-linux-musl
|
||||
|
||||
### RUN
|
||||
FROM scratch
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY --from=build /app/target/x86_64-unknown-linux-musl/release/widertom widertom
|
||||
|
||||
CMD ["/app/widertom"]
|
||||
4
run.sh
Normal file
4
run.sh
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
docker run -d -v "$(pwd)/config.toml:/app/config.toml" -v "$(pwd)/bot_token:/app/bot_token" \
|
||||
-e CONFIG_PATH=/app/config.toml -e BOT_TOKEN_PATH=/app/bot_token --name widertom widertom:1.0
|
||||
Loading…
Add table
Add a link
Reference in a new issue