Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 3 additions & 26 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,26 +1,3 @@
# Logs
logs
*.log
npm-debug.log*

# NPM
node_modules/*

# Build output
dist/
.astro/

# logs
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*

# Just in case somebody runs the wrong command
yarn.lock
pnpm-lock.yaml
tsconfig.tsbuildinfo
bun.lockb

# Mac shit
.DS_Store
.git
node_modules
infra
11 changes: 9 additions & 2 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,15 @@ jobs:

steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
run_install: false

- uses: actions/setup-node@v4
with:
cache: 'pnpm'

- uses: biomejs/setup-biome@v2

- run: npm ci
- run: npm run check
- run: pnpm install --frozen-lockfile
- run: pnpm run check
45 changes: 0 additions & 45 deletions .github/workflows/update.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ pnpm-debug.log*

# Just in case somebody runs the wrong command
yarn.lock
pnpm-lock.yaml
package-lock.json
tsconfig.tsbuildinfo
bun.lockb

Expand Down
23 changes: 16 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
FROM node:slim
FROM node:slim AS base
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
ENV NODE_ENV=production

RUN corepack enable

COPY . /app
WORKDIR /app
ENV NODE_ENV=production

COPY package.json package-lock.json .
RUN npm ci
FROM base AS prod-deps
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --prod --frozen-lockfile

COPY . .
RUN npm run build
FROM base AS build
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
RUN pnpm run build

FROM base
COPY --from=prod-deps /app/node_modules /app/node_modules
COPY --from=build /app/dist /app/dist
ENV HOST="0.0.0.0"
CMD [ "node", "./dist/server/entry.mjs" ]
CMD [ "node", "./dist/server/entry.mjs" ]
28 changes: 3 additions & 25 deletions astro.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ import tailwind from "@astrojs/tailwind";
import { defineConfig } from "astro/config";

import mkcert from "vite-plugin-mkcert";
import { viteStaticCopy } from "vite-plugin-static-copy";
import wasm from "vite-plugin-wasm";

// https://astro.build/config
export default defineConfig({
Expand All @@ -35,36 +33,16 @@ export default defineConfig({
fs: {
allow: [
".",
// Allow `npm link @kixelated/moq`
fs.realpathSync(path.resolve("node_modules/@kixelated/moq")),
// Allow `npm link @kixelated/hang`
fs.realpathSync(path.resolve("node_modules/@kixelated/hang")),
],
},
},
plugins: [
mkcert(),
wasm(),
viteStaticCopy({
hook: "buildStart",
targets: [
{
src: "node_modules/@shoelace-style/shoelace/dist/assets/**/*",
dest: "assets",
},
],
}),
],
worker: {
format: "es",
plugins: () => [wasm()],
},
plugins: [mkcert()],
resolve: {
alias: {
"@": "/src",
},
},
// Workaround for: https://github.com/vitejs/vite/issues/8427
optimizeDeps: {
exclude: ["@kixelated/moq"],
},
},
});
Binary file removed bun.lockb
Binary file not shown.
14 changes: 7 additions & 7 deletions infra/pub.yml.tpl
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
#cloud-config

write_files:
- path: /etc/systemd/system/moq-bbb.service
- path: /etc/systemd/system/hang-bbb.service
permissions: 0644
owner: root
content: |
[Unit]
Description=Run moq-bbb via docker
Description=Run hang-bbb via docker
Requires=docker.service
After=docker.service

[Service]
ExecStart=docker run --rm \
--name moq-bbb \
--name hang-bbb \
--network="host" \
--pull=always \
--cap-add=SYS_PTRACE \
-e RUST_LOG=debug -e RUST_BACKTRACE=1 \
-e REGION=${region} \
--entrypoint moq-bbb \
${docker}/moq-karp \
publish "https://relay.quic.video/demo/bbb"
--entrypoint hang-bbb \
${docker}/hang \
publish "https://relay.quic.video/demo/bbb.hang"

ExecStop=docker stop moq-bbb
ExecStop=docker stop hang-bbb

# Take longer and longer to restart the process.
Restart=always
Expand Down
Loading