Skip to content
Open
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
2 changes: 1 addition & 1 deletion apps/media-server/railway.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[build]
dockerfilePath = "apps/media-server/Dockerfile"
dockerfilePath = "Dockerfile.standalone"

[deploy]
startCommand = "bun run src/index.ts"
Expand Down
6 changes: 3 additions & 3 deletions apps/web-cluster/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ COPY . .
RUN corepack enable pnpm

RUN echo "inject-workspace-packages=true" >> .npmrc
RUN --mount=type=cache,id=pnpm,target=/root/.local/share/pnpm/store pnpm i
RUN pnpm i

RUN pnpm run --filter=@cap/web-cluster build
RUN pnpm deploy --filter=@cap/web-cluster out
Expand All @@ -21,8 +21,8 @@ COPY --from=builder --chown=deno:deno /app/out /app

USER deno

ENTRYPOINT ["deno", "run", "--allow-all"]

EXPOSE 8080
EXPOSE 42069
EXPOSE 42169

CMD ["deno", "run", "--allow-all", "src/runner/index.ts"]
27 changes: 27 additions & 0 deletions apps/web-cluster/Dockerfile.shard-manager
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
FROM node:24-slim AS base
RUN corepack enable

FROM base AS builder
WORKDIR /app
COPY . .

RUN corepack enable pnpm

RUN echo "inject-workspace-packages=true" >> .npmrc
RUN pnpm i

RUN pnpm run --filter=@cap/web-cluster build
RUN pnpm deploy --filter=@cap/web-cluster out
RUN cd out && node scripts/post-deploy.ts

FROM denoland/deno:2.5.3 AS runner
WORKDIR /app

COPY --from=builder --chown=deno:deno /app/out /app

USER deno

EXPOSE 8080
EXPOSE 42069

CMD ["deno", "run", "--allow-all", "src/shard-manager.ts"]
7 changes: 7 additions & 0 deletions apps/web-cluster/src/shard-manager.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { RunnerAddress } from "@effect/cluster";
import {
NodeClusterShardManagerSocket,
NodeRuntime,
Expand All @@ -6,8 +7,14 @@ import { Layer, Logger } from "effect";

import { DatabaseLive, ShardDatabaseLive } from "./shared/database.ts";

const shardManagerHost = Deno.env.get("SHARD_MANAGER_HOST") ?? "0.0.0.0";
const shardManagerAddress = `${shardManagerHost}:8080`;

NodeClusterShardManagerSocket.layer({
storage: "sql",
shardingConfig: {
shardManagerAddress: RunnerAddress.make(shardManagerAddress),
},
}).pipe(
Layer.provide(ShardDatabaseLive),
Layer.provide(DatabaseLive),
Expand Down
4 changes: 1 addition & 3 deletions apps/web/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# syntax=docker.io/docker/dockerfile:1

FROM node:24-alpine AS base
RUN corepack enable

Expand All @@ -8,7 +6,7 @@ WORKDIR /app
COPY . .

RUN corepack enable pnpm
RUN --mount=type=cache,id=pnpm,target=/root/.local/share/pnpm/store pnpm i --frozen-lockfile
RUN pnpm i --frozen-lockfile

ARG NEXT_PUBLIC_DOCKER_BUILD=true
ENV NEXT_PUBLIC_WEB_URL=http://localhost:3000
Expand Down
5 changes: 4 additions & 1 deletion packages/utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@
"build": "tsdown"
},
"publishConfig": {
"main": "./dist/index.js"
"main": "./dist/index.js",
"exports": {
".": "./dist/index.js"
}
},
"devDependencies": {
"react": "^19.1.1",
Expand Down