Skip to content

Commit 5a9cd7d

Browse files
authored
fly deploy (#272)
1 parent 7b7cc7f commit 5a9cd7d

File tree

4 files changed

+30
-18
lines changed

4 files changed

+30
-18
lines changed

Dockerfile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ RUN --mount=type=cache,id=workspace,target=/root/.local/share/pnpm/store pnpm in
2424
# Build stage for the server.
2525
FROM base AS build
2626
# TODO: Remove this when we switch to an actual database.
27-
ENV DATABASE_URL="file:./dev.db"
27+
# ENV DATABASE_URL="file:./dev.db"
2828
RUN \
2929
# TODO: This initalizes the database. But we should probably remove this later.
30-
pnpm --filter server prisma migrate reset --force && \
30+
# pnpm --filter server prisma migrate reset --force && \
3131
# Build the monorepo packages
3232
pnpm build && \
3333
# Generate the prisma client
@@ -48,6 +48,7 @@ FROM node:22-alpine AS server
4848
WORKDIR /app
4949
COPY --from=build /workspace/deployment/out .
5050
# TODO: Remove this when we switch to an actual database.
51-
ENV DATABASE_URL="file:./dev.db"
51+
ENV DATABASE_URL="file:/mnt/hypergraph_data/production.sqlite"
52+
RUN npm run prisma migrate deploy --skip-generate
5253
EXPOSE 3030
53-
CMD ["node", "dist/index.js"]
54+
CMD ["sh", "-c", "npm run prisma migrate deploy && node dist/index.js"]

apps/server/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
"cors": "^2.8.5",
2222
"effect": "^3.16.3",
2323
"express": "^5.1.0",
24+
"prisma": "^6.7.0",
2425
"siwe": "^3.0.0",
2526
"viem": "^2.29.0",
2627
"ws": "^8.18.2"
@@ -31,7 +32,6 @@
3132
"@types/node": "^22.15.15",
3233
"@types/pg": "^8.15.0",
3334
"@types/ws": "^8.18.1",
34-
"prisma": "^6.7.0",
3535
"tsup": "^8.4.0",
3636
"typescript": "^5.8.3"
3737
}

fly.toml

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,21 @@ primary_region = 'fra'
99
[build]
1010

1111
[http_service]
12-
internal_port = 3030
13-
force_https = true
14-
auto_stop_machines = 'stop'
15-
auto_start_machines = true
16-
min_machines_running = 0
17-
processes = ['app']
12+
internal_port = 3030
13+
force_https = true
14+
auto_stop_machines = 'stop'
15+
auto_start_machines = true
16+
min_machines_running = 0
17+
processes = ['app']
1818

1919
[[vm]]
20-
memory = '1gb'
21-
cpu_kind = 'shared'
22-
cpus = 1
20+
memory = '1gb'
21+
cpu_kind = 'shared'
22+
cpus = 1
23+
24+
[mounts]
25+
source = "hypergraph_data"
26+
destination = "/mnt/hypergraph_data"
27+
28+
# [deploy]
29+
# release_command = "/bin/sh -c 'npm run prisma migrate deploy --skip-generate'"

pnpm-lock.yaml

Lines changed: 8 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)