From 229c428a1edd34e2630c9ca10051b641746a5366 Mon Sep 17 00:00:00 2001 From: Jacob Zweifel Date: Fri, 6 Oct 2023 16:15:03 -0500 Subject: [PATCH] update fly deployment to have health checks --- .dockerignore | 13 +++++++++++++ Dockerfile | 2 +- fly.toml | 13 +++++++++++++ 3 files changed, 27 insertions(+), 1 deletion(-) diff --git a/.dockerignore b/.dockerignore index ae04859..a0dbf24 100644 --- a/.dockerignore +++ b/.dockerignore @@ -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 diff --git a/Dockerfile b/Dockerfile index de899b8..b9bd772 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 diff --git a/fly.toml b/fly.toml index bc85b71..156a5aa 100644 --- a/fly.toml +++ b/fly.toml @@ -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 @@ -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"