Skip to content

Commit a58ba8f

Browse files
committed
add railway deployment instructions
1 parent c87d20e commit a58ba8f

2 files changed

Lines changed: 21 additions & 2 deletions

File tree

CONTRIBUTING.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,25 @@ cd apps/typesync
2323
pnpm publish --tag latest
2424
```
2525

26+
## Deploying your own SyncServer to Railway
27+
28+
Setup a service and attach a volume under `/data` to it.
29+
30+
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.
31+
32+
To do so you can fill in the service ID below and run the command before your `railway up` command.
33+
More info here: https://docs.railway.com/guides/dockerfiles#cache-mounts
34+
Get the service ID by using CMD/CTRL+K and search for `Copy Service ID`.
35+
36+
```sh
37+
sed -i '' \
38+
's|\(--mount=type=cache,id=\)workspace|\1s/<service-id>-pnpm-store|' \
39+
Dockerfile
40+
railway up
41+
```
42+
43+
Note: By default horizontal scaling is disabled because of the attached volume.
44+
2645
## Deploying your own SyncServer to Fly.io (single instance)
2746

2847
```sh

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ ENV PRISMA_SKIP_POSTINSTALL_GENERATE=true
1616
ENV CI=true
1717
# Fetch all node modules purely based on the pnpm lock file.
1818
COPY pnpm-lock.yaml .
19-
RUN --mount=type=cache,id=workspace,target=/root/.local/share/pnpm/store pnpm fetch
19+
RUN --mount=type=cache,id=s/09abeb21-f1c0-4291-8bc0-ca90bb08233f-pnpm-store,target=/root/.local/share/pnpm/store pnpm fetch
2020
# Copy the entire workspace into the scope and perform the actual installation.
2121
COPY . .
22-
RUN --mount=type=cache,id=workspace,target=/root/.local/share/pnpm/store pnpm install
22+
RUN --mount=type=cache,id=s/09abeb21-f1c0-4291-8bc0-ca90bb08233f-pnpm-store,target=/root/.local/share/pnpm/store pnpm install
2323

2424
# Build stage for the server.
2525
FROM base AS build

0 commit comments

Comments
 (0)