-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
20 additions
and
13 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
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,22 +1,30 @@ | ||
FROM --platform=$BUILDPLATFORM tonistiigi/xx AS xx | ||
ARG TARGETARCH | ||
|
||
FROM --platform=$BUILDPLATFORM rust:alpine AS builder | ||
ENV OPENSSL_STATIC=yes | ||
RUN apk add musl-dev alpine-sdk perl clang lld && rustup target add wasm32-unknown-unknown && cargo install dioxus-cli | ||
FROM messense/rust-musl-cross:x86_64-musl-amd64 AS builder-amd64 | ||
FROM messense/rust-musl-cross:aarch64-musl-amd64 AS builder-arm64 | ||
|
||
FROM builder-${TARGETARCH} as builder | ||
ARG TARGETARCH | ||
ARG TARGETPLATFORM | ||
WORKDIR /usr/src/clip-sync | ||
COPY --from=xx / / | ||
WORKDIR /usr/src/ | ||
COPY . ./ | ||
RUN cargo build --release --no-default-features --features server-only --target=$(xx-info march)-unknown-linux-musl && \ | ||
cp /usr/src/target/$(xx-info march)-unknown-linux-musl/release/clip-sync / | ||
|
||
FROM rust:buster AS ui-builder | ||
WORKDIR /usr/src/clip-sync | ||
COPY . . | ||
RUN xx-cargo build --release --no-default-features --features server-only && \ | ||
cd clip-sync-ui && dx build --release | ||
RUN rustup target add wasm32-unknown-unknown && cargo install dioxus-cli | ||
RUN cd clip-sync-ui && dx build --release | ||
|
||
FROM --platform=$BUILDPLATFORM alpine | ||
FROM alpine | ||
RUN apk add --update openssl bash | ||
RUN mkdir /index | ||
COPY --from=builder /usr/src/clip-sync/target/release/clip-sync /app/clip-sync | ||
COPY --from=builder /usr/src/clip-sync/config-server.toml /config/config.toml | ||
COPY --from=builder /usr/src/clip-sync/clip-sync-ui/dist /static-files | ||
COPY --from=builder /clip-sync /app/clip-sync | ||
COPY --from=builder /usr/src/config.toml /config/config.toml | ||
COPY --from=ui-builder /usr/src/clip-sync/clip-sync-ui/dist /static-files | ||
EXPOSE 3000 | ||
WORKDIR / | ||
CMD ["/app/clip-sync", "--config", "/config/config.toml"] |
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,4 +1,3 @@ | ||
roles = ["server"] | ||
|
||
[server] | ||
endpoint = "0.0.0.0:3000" | ||
index-path = "/index" |