From 022b9423c0a5821452370acb6ab4022fcafbae1a Mon Sep 17 00:00:00 2001 From: Mateus Torres Date: Sat, 11 Oct 2025 21:56:41 -0300 Subject: [PATCH] fix(devops): Enable HMR/Watch by correcting CMD and NODE_ENV\n\nUpdates the Dockerfile CMD to use 'nodemon server.js' and overrides NODE_ENV to 'development' in compose.yaml to enable the hot-reloading feature. --- app/Dockerfile | 4 ++-- compose.yaml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Dockerfile b/app/Dockerfile index 49d1ad4..ce87f9f 100644 --- a/app/Dockerfile +++ b/app/Dockerfile @@ -9,7 +9,7 @@ ARG NODE_VERSION=19.5.0 FROM node:${NODE_VERSION}-alpine # Use production node environment by default. -ENV NODE_ENV production +ENV NODE_ENV=production WORKDIR /usr/src/app @@ -38,4 +38,4 @@ USER node EXPOSE 3000 # Run the application in dev mode to use with Compose watch feature -CMD npm run dev +CMD ["nodemon", "server.js"] diff --git a/compose.yaml b/compose.yaml index da717fa..6347a59 100644 --- a/compose.yaml +++ b/compose.yaml @@ -15,7 +15,7 @@ services: depends_on: - todo-database environment: - NODE_ENV: production + NODE_ENV: development ports: - 3000:3000 - 35729:35729