diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..fdbcffd --- /dev/null +++ b/.dockerignore @@ -0,0 +1,18 @@ +# flyctl launch added from .gitignore +# Generated by Cargo +# will have compiled files and executables +target +**/pkg + +# These are backup files generated by rustfmt +**/**/*.rs.bk + +# node e2e test tools and outputs +**/node_modules +**/test-results +**/end2end/playwright-report +**/playwright/.cache + +# flyctl launch added from node_modules/.pnpm/tailwindcss@3.4.3/node_modules/tailwindcss/stubs/.gitignore +!node_modules/.pnpm/tailwindcss@3.4.3/node_modules/tailwindcss/stubs/**/* +fly.toml diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..ccd0a91 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,31 @@ +# Get started with a build env with Rust nightly +FROM rustlang/rust:nightly-alpine as builder + +RUN apk update && \ + apk add --no-cache bash curl npm libc-dev binaryen + +RUN npm install -g tailwind + +RUN curl --proto '=https' --tlsv1.2 -LsSf https://github.com/leptos-rs/cargo-leptos/releases/latest/download/cargo-leptos-installer.sh | sh + +# Add the WASM target +RUN rustup target add wasm32-unknown-unknown + +WORKDIR /work +COPY . . + +RUN cargo leptos build --release -vv + +FROM rustlang/rust:nightly-alpine as runner + +WORKDIR /app + +COPY --from=builder /work/target/release/hls-test /app/ +COPY --from=builder /work/target/site /app/site +COPY --from=builder /work/Cargo.toml /app/ + +EXPOSE $PORT +ENV LEPTOS_SITE_ROOT=./site +ENV LEPTOS_SITE_ADDR="0.0.0.0:3000" + +CMD ["/app/hls-test"] diff --git a/fly.toml b/fly.toml new file mode 100644 index 0000000..cb707da --- /dev/null +++ b/fly.toml @@ -0,0 +1,22 @@ +# fly.toml app configuration file generated for hls-test-rupansh on 2024-05-15T21:58:55+05:30 +# +# See https://fly.io/docs/reference/configuration/ for information about how to use this file. +# + +app = 'hls-test-rupansh' +primary_region = 'sin' + +[build] + +[http_service] + internal_port = 3000 + force_https = true + auto_stop_machines = true + auto_start_machines = true + min_machines_running = 0 + processes = ['app'] + +[[vm]] + memory = '512mb' + cpu_kind = 'shared' + cpus = 1