Skip to content

Commit

Permalink
Merge branch 'master' into status
Browse files Browse the repository at this point in the history
  • Loading branch information
Mubelotix committed Jun 1, 2024
2 parents fbd4426 + f80e8e3 commit 52cf660
Show file tree
Hide file tree
Showing 5 changed files with 84 additions and 23 deletions.
9 changes: 5 additions & 4 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
target/debug
target/release
target/tmp
target/wasm32-unknown-unknown
target/wasm-bindgen
target/release/build
target/release/deps
target/release/examples
target/release/incremental
target/*/*/build
target/*/*/deps
target/*/*/examples
target/*/*/incremental
webui/dist
15 changes: 10 additions & 5 deletions .github/workflows/publish-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ on:
- 'word-lists/**'
- 'kamilata/**'
- 'discovery-protocol/**'
- 'Dockerfile'
- '.github/workflows/publish-docker.yml'

env:
REGISTRY: ghcr.io
Expand All @@ -27,15 +29,18 @@ jobs:
- uses: actions/cache@v2
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
~/.cargo/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/publish-docker.yml') }}

- name: Install musl target
run: rustup target add x86_64-unknown-linux-musl

- name: Install musl-tools
run: sudo apt-get update && sudo apt-get install -y musl-tools

- name: Build with cargo
run: cargo build --release
run: cargo build --release --target=x86_64-unknown-linux-musl --package admarusd

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
Expand Down
66 changes: 61 additions & 5 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 6 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ARG SKIP_BUILD=false

# Build stage
FROM rust:1-slim-bookworm as build
FROM messense/rust-musl-cross:x86_64-musl as build

RUN apt-get update && apt-get install -y pkg-config libssl-dev && apt-get clean

Expand All @@ -10,21 +10,19 @@ COPY . .

ARG SKIP_BUILD
RUN if [ "$SKIP_BUILD" = "false" ]; then \
cargo build --release --package admarusd; \
fi
cargo build --release --target=x86_64-unknown-linux-musl --package admarusd; \
fi;

RUN cp target/release/admarusd /usr/local/bin/admarusd && \
RUN cp target/x86_64-unknown-linux-musl/release/admarusd /usr/local/bin/admarusd && \
cd .. && \
rm -rf admarus

# Final stage
FROM debian:bookworm-slim

RUN apt-get update && apt-get install -y libssl3 ca-certificates && apt-get clean
FROM alpine:latest

COPY --from=build /usr/local/bin/admarusd /usr/local/bin/admarusd

EXPOSE 4002
EXPOSE 5002

ENTRYPOINT ["/usr/local/bin/admarusd"]
CMD ["/usr/local/bin/admarusd"]
3 changes: 2 additions & 1 deletion daemon/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[package]
name = "admarusd"
authors = ["Mubelotix <[email protected]>"]
version = "0.1.0"
edition = "2021"

Expand All @@ -19,7 +20,7 @@ tokio = { version = "1.29", features = ["full"] }
async-trait = "0.1"
scraper = "0.19"
warp = {version="0.3", default-features = false}
reqwest = {version="0.12", features=["multipart"], default-features = false}
reqwest = {version="0.12", features=["multipart", "http2", "rustls-tls"], default-features = false}
futures = "0.3"
rand = "0.8"
log = "0.4"
Expand Down

0 comments on commit 52cf660

Please sign in to comment.