Skip to content

Commit

Permalink
fix start script
Browse files Browse the repository at this point in the history
  • Loading branch information
kentcdodds committed Mar 15, 2022
1 parent 8b5a4ef commit 946adc8
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
1 change: 0 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,4 @@ COPY --from=build /myapp/build /myapp/build
COPY --from=build /myapp/public /myapp/public
ADD . .

RUN npx prisma migrate deploy
CMD ["npm", "start"]
2 changes: 2 additions & 0 deletions fly.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ processes = []
[experimental]
allowed_public_ports = []
auto_rollback = true
cmd = "start.sh"
entrypoint = "sh"

[mounts]
source = "data"
Expand Down
10 changes: 10 additions & 0 deletions start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# This file is how Fly starts the server (configured in fly.toml). Before starting
# the server though, we need to run any prisma migrations that haven't yet been
# run, which is why this file exists in the first place.
# Learn more: https://community.fly.io/t/sqlite-not-getting-setup-properly/4386

#!/bin/sh

set -ex
npx prisma migrate deploy
npm run start

0 comments on commit 946adc8

Please sign in to comment.