diff options
author | Ashelyn Rose <git@ashen.earth> | 2025-03-21 23:15:01 -0600 |
---|---|---|
committer | Ashelyn Rose <git@ashen.earth> | 2025-03-21 23:15:01 -0600 |
commit | b18f08e8899b5a98dd3e1f8439ad812951a04cd9 (patch) | |
tree | 613dac28974eee66b193f48402c3ecb9b0663c88 /docker | |
parent | 2683366e92676abf687c37f4afea4d4d721cb059 (diff) |
Container
Diffstat (limited to 'docker')
-rw-r--r-- | docker/app.Dockerfile | 32 | ||||
-rw-r--r-- | docker/builder.Dockerfile | 14 |
2 files changed, 46 insertions, 0 deletions
diff --git a/docker/app.Dockerfile b/docker/app.Dockerfile new file mode 100644 index 0000000..66c2fe4 --- /dev/null +++ b/docker/app.Dockerfile @@ -0,0 +1,32 @@ +FROM leptos-builder-musl AS builder + +WORKDIR /build +COPY . . + +# needs to exist for clippy +RUN mkdir -p target/stormscribe +RUN cargo clippy -- -D warnings + +# RUN cargo leptos test +RUN cargo leptos build --release + + +# --------- # + + +FROM scratch AS app + +ENV LEPTOS_OUTPUT_NAME=stormscribe +ENV LEPTOS_SITE_ROOT=files +ENV LEPTOS_SITE_PKG_DIR=pkg +ENV LEPTOS_SITE_ADDR="0.0.0.0:3000" +ENV LEPTOS_RELOAD_PORT=3001 + +USER 10001 +WORKDIR /app +COPY --chown=10001:10001 --from=builder /build/target/stormscribe/ ./files/ +COPY --chown=10001:10001 --from=builder /build/target/release/stormscribe . +EXPOSE 3000 + +ENTRYPOINT ["/app/stormscribe"] + diff --git a/docker/builder.Dockerfile b/docker/builder.Dockerfile new file mode 100644 index 0000000..1df5c3e --- /dev/null +++ b/docker/builder.Dockerfile @@ -0,0 +1,14 @@ +FROM rust:1.85-alpine3.20 + +RUN apk update && \ + apk add --no-cache bash binaryen gcc git g++ libc-dev make npm openssl-dev openssl-libs-static zlib-static zlib-dev protobuf-dev protoc perl + +RUN rustup target add wasm32-unknown-unknown +RUN rustup component add clippy + +RUN cargo install cargo-generate +RUN cargo install cargo-leptos + +WORKDIR /build + +CMD /bin/bash |