Skip to content

Commit

Permalink
update fly deployment to have health checks
Browse files Browse the repository at this point in the history
  • Loading branch information
jzweifel committed Oct 6, 2023
1 parent 9323629 commit 229c428
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 1 deletion.
13 changes: 13 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,17 @@
cockroach-data
.dockerignore
.gitignore
.env
.toolversions
.github
.husky
.vscode
docker-compose.yml
Dockerfile
fly-toml
lint-staged.config.cjs
prettier.config.cjs
README.md

# Based on https://raw.githubusercontent.com/github/gitignore/main/Node.gitignore

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ COPY --link . .
RUN npx prisma generate

# Final stage for app image
FROM base
FROM base as final

# Copy built application
COPY --from=build /app /app
Expand Down
13 changes: 13 additions & 0 deletions fly.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ app = "hypertext-blog"
primary_region = "ord"

[build]
dockerfile = "Dockerfile"
ignorefile = ".dockerignore"
build-target = "final"

[deploy]
strategy = "rolling"

[http_service]
internal_port = 3000
Expand All @@ -16,6 +22,13 @@ primary_region = "ord"
min_machines_running = 0
processes = ["app"]

[[http_service.checks]]
grace_period = "10s"
interval = "30s"
method = "GET"
timeout = "5s"
path = "/"

[env]
NODE_ENV="production"
LOG_LEVEL="info"
Expand Down

0 comments on commit 229c428

Please # to comment.