Skip to content

Commit c6e2230

Browse files
authored
railway sync server (#356)
1 parent bea0602 commit c6e2230

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

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: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ WORKDIR /app
4949
COPY --from=build /workspace/deployment/out .
5050
# TODO: Remove this when we switch to an actual database.
5151
ENV DATABASE_URL="file:/data/production.sqlite"
52-
RUN npm run prisma migrate deploy --skip-generate
5352
EXPOSE 3030
5453
# can't use fly.io release_command because it doesn't mount the volume containing the sqlite db file
5554
CMD ["sh", "-c", "npm run prisma migrate deploy && node dist/index.js"]

0 commit comments

Comments
 (0)