feat: create docker dependencies for cloud deployment
This commit is contained in:
1 parent
a01feb5e34
commit
15b8aee844
4 files changed
+68
-38
No files matched your search
+6
-3
@@ -1,7 +1,7 @@
|
||||
FROM rust:1.86 AS builder
|
||||
FROM rust:1.90 AS builder
|
||||
|
||||
# Install node for tailwind capability
|
||||
RUN apt-get update -y && apt-get install -y --no-install-recommends clang libc6
|
||||
RUN apt-get update -y && apt-get install -y --no-install-recommends clang libc6 mold
|
||||
RUN wget https://github.com/cargo-bins/cargo-binstall/releases/latest/download/cargo-binstall-x86_64-unknown-linux-musl.tgz
|
||||
RUN tar -xvf cargo-binstall-x86_64-unknown-linux-musl.tgz
|
||||
RUN curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash
|
||||
@@ -15,6 +15,7 @@ WORKDIR /app
|
||||
COPY . .
|
||||
|
||||
# Setup fnm and build with leptos
|
||||
# If this doesn't work, we should use nvm as this is a proven solution.
|
||||
RUN cargo binstall fnm -y \
|
||||
&& fnm --version \
|
||||
&& eval "$(fnm env)" \
|
||||
@@ -26,7 +27,7 @@ RUN cargo binstall fnm -y \
|
||||
|
||||
# Start second phase of build - install ca-certs and copy all build outputs from previous step into a
|
||||
# Debian image in the /app directory.
|
||||
FROM debian:bookworm-slim AS runtime
|
||||
FROM debian:trixie-slim AS runtime
|
||||
WORKDIR /app
|
||||
RUN apt-get update -y \
|
||||
&& apt-get install -y --no-install-recommends openssl ca-certificates \
|
||||
@@ -46,6 +47,8 @@ COPY --from=builder /app/Cargo.toml /app/
|
||||
ENV RUST_LOG="info"
|
||||
ENV LEPTOS_SITE_ADDR="0.0.0.0:8080"
|
||||
ENV LEPTOS_SITE_ROOT="site"
|
||||
# Staging URL for server.
|
||||
ENV LP_SITE_ORIGIN="http://testing-url.com"
|
||||
EXPOSE 8080
|
||||
|
||||
# Don't forget about project_name
|
||||
|
||||
Reference in new issue
Block a user