This commit is contained in:
parent
e496324049
commit
2329b80ed8
8 changed files with 1113 additions and 8 deletions
3
.dockerignore
Normal file
3
.dockerignore
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
target
|
||||||
|
Dockerfile
|
||||||
|
.dockerignore
|
4
.gitignore
vendored
4
.gitignore
vendored
|
@ -4,10 +4,6 @@
|
||||||
debug/
|
debug/
|
||||||
target/
|
target/
|
||||||
|
|
||||||
# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
|
|
||||||
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
|
|
||||||
Cargo.lock
|
|
||||||
|
|
||||||
# These are backup files generated by rustfmt
|
# These are backup files generated by rustfmt
|
||||||
**/*.rs.bk
|
**/*.rs.bk
|
||||||
|
|
||||||
|
|
14
.woodpecker.yml
Normal file
14
.woodpecker.yml
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
pipeline:
|
||||||
|
build-and-publish:
|
||||||
|
image: plugins/docker
|
||||||
|
settings:
|
||||||
|
registry: git.makerlab-murnau.de
|
||||||
|
repo: git.makerlab-murnau.de/makerlab/matrix-bot
|
||||||
|
auto_tag: true
|
||||||
|
dockerfile: Dockerfile
|
||||||
|
username:
|
||||||
|
from_secret: gitea_username
|
||||||
|
password:
|
||||||
|
from_secret: gitea_password
|
||||||
|
when:
|
||||||
|
branch: main
|
1080
Cargo.lock
generated
Normal file
1080
Cargo.lock
generated
Normal file
File diff suppressed because it is too large
Load diff
|
@ -7,10 +7,9 @@ edition = "2021"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
png = "0.11.0"
|
png = "0.11.0"
|
||||||
cairo-rs = { version = "0.17.0", features = ["png"] }
|
cairo-rs = { version = "0.17.0", default-features = false, features = ["png"] }
|
||||||
axum = "0.6.10"
|
axum = "0.6.10"
|
||||||
tokio = { version = "1.0", features = ["full"] }
|
tokio = { version = "1.0", features = ["full"] }
|
||||||
base64 = "0.21.0"
|
|
||||||
rand = "0.8.5"
|
rand = "0.8.5"
|
||||||
serde = { version = "1.0.152", features = ["derive"] }
|
serde = { version = "1.0.152", features = ["derive"] }
|
||||||
rust-embed = "6.6.0"
|
rust-embed = "6.6.0"
|
||||||
|
|
13
Dockerfile
Normal file
13
Dockerfile
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
FROM rust:1.68-bookworm as build
|
||||||
|
WORKDIR /build
|
||||||
|
COPY . .
|
||||||
|
ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse
|
||||||
|
RUN echo $(rustup show | head -n 1 | awk '{print $NF}') > /platform
|
||||||
|
RUN cargo build --release --target $(cat /platform) --bin logo-generator
|
||||||
|
RUN mv target/$(cat /platform)/release/logo-generator logo-generator
|
||||||
|
|
||||||
|
FROM debian:bookworm-slim
|
||||||
|
RUN apt-get update && apt-get install -y libcairo2-dev && rm -rf /var/lib/apt/lists/*
|
||||||
|
COPY --from=build /build/logo-generator /logo-generator
|
||||||
|
EXPOSE 3000
|
||||||
|
CMD ["/logo-generator"]
|
|
@ -18,7 +18,7 @@ async fn main() {
|
||||||
.with_state(state);
|
.with_state(state);
|
||||||
|
|
||||||
// run it
|
// run it
|
||||||
let addr = SocketAddr::from(([127, 0, 0, 1], 3000));
|
let addr = SocketAddr::from(([0, 0, 0, 0], 3000));
|
||||||
println!("listening on {}", addr);
|
println!("listening on {}", addr);
|
||||||
axum::Server::bind(&addr)
|
axum::Server::bind(&addr)
|
||||||
.serve(app.into_make_service())
|
.serve(app.into_make_service())
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
</ul>
|
</ul>
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="https://makerlab-murnau.de">MakerLab Website</a></li>
|
<li><a href="https://makerlab-murnau.de">MakerLab Website</a></li>
|
||||||
<li><a href="https://git.makerlab-murnau.de/Projekte/logo-generator">Source code</a></li>
|
<li><a href="https://git.makerlab-murnau.de/MakerLab/logo-generator">Source code</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue