Skip to content

Commit

Permalink
init CI
Browse files Browse the repository at this point in the history
  • Loading branch information
rupansh committed May 27, 2024
1 parent 4982224 commit dacf0f6
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -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/[email protected]/node_modules/tailwindcss/stubs/.gitignore
!node_modules/.pnpm/[email protected]/node_modules/tailwindcss/stubs/**/*
fly.toml
31 changes: 31 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]
22 changes: 22 additions & 0 deletions fly.toml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit dacf0f6

Please sign in to comment.