From 6ff73bf519977e8a24d70eebb47f2f1656882a1f Mon Sep 17 00:00:00 2001 From: solufa Date: Mon, 10 Jun 2024 20:35:31 +0900 Subject: [PATCH] chore: add HEALTHCHECK --- Dockerfile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index afbcdcc..0b13d9d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,8 +13,10 @@ RUN npm ci --prefix server COPY . . ARG NEXT_PUBLIC_FIREBASE_CONFIG -ARG API_BASE_PATH ARG DATABASE_URL +ENV API_BASE_PATH RUN npm run build -CMD npm start +HEALTHCHECK --interval=5s --timeout=5s --retries=3 CMD curl -f http://localhost:$PORT/$API_BASE_PATH/health && curl -f http://localhost:$PORT || exit 1 + +CMD ["npm", "start"]