From c87d20e550247b5909bbaf8bcf4355a84a570d42 Mon Sep 17 00:00:00 2001 From: Nik Graf Date: Tue, 22 Jul 2025 07:10:02 +0200 Subject: [PATCH 1/2] fix cache id mount --- Dockerfile | 1 - 1 file changed, 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index d8c33d7b..858a2195 100644 --- a/Dockerfile +++ b/Dockerfile @@ -49,7 +49,6 @@ WORKDIR /app COPY --from=build /workspace/deployment/out . # TODO: Remove this when we switch to an actual database. ENV DATABASE_URL="file:/data/production.sqlite" -RUN npm run prisma migrate deploy --skip-generate EXPOSE 3030 # can't use fly.io release_command because it doesn't mount the volume containing the sqlite db file CMD ["sh", "-c", "npm run prisma migrate deploy && node dist/index.js"] \ No newline at end of file From c15cae3fbfac0f557022a789599715e20c601ccb Mon Sep 17 00:00:00 2001 From: Nik Graf Date: Tue, 22 Jul 2025 08:45:23 +0200 Subject: [PATCH 2/2] add railway deployment instructions --- CONTRIBUTING.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 3ede2f8e..1795b09e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -23,6 +23,25 @@ cd apps/typesync pnpm publish --tag latest ``` +## Deploying your own SyncServer to Railway + +Setup a service and attach a volume under `/data` to it. + +Since cache-mounts on Railway need to prefixed with the service ID and BuildKit doesn’t expand variables there. You must give it a literal value for the mount ID. + +To do so you can fill in the service ID below and run the command before your `railway up` command. +More info here: https://docs.railway.com/guides/dockerfiles#cache-mounts +Get the service ID by using CMD/CTRL+K and search for `Copy Service ID`. + +```sh +sed -i '' \ + 's|\(--mount=type=cache,id=\)workspace|\1s/-pnpm-store|' \ + Dockerfile +railway up +``` + +Note: By default horizontal scaling is disabled because of the attached volume. + ## Deploying your own SyncServer to Fly.io (single instance) ```sh