build: Improve Docker dev setup, add nodemon config (#1145)

* Updated the base image in `Dockerfile.dev` from `node:18-alpine` to `node:lts-alpine` to use more or less the same as for production docker build (where the client is build lts and server is 18... so yeah not really...)
* Removed the `USER node` directive, to prevent permission issues as we hook the whole folder into the container.
* Modified the `docker-compose-dev.yml` file to enhance the database healthcheck. The new healthcheck ensures not only postgres is ready but also the database is ready by running a sample query (`SELECT 1`) and adjusts the interval, retries, and start period for better reliability.
* Added a `nodemon.json` configuration file to watch only relevant files (node_modules would be ignored but not files like the python venv) and avoid rapid successive restarts with the delay.
This commit is contained in:
Hannes
2025-05-23 16:19:22 +02:00
committed by GitHub
parent 86cfd155f2
commit f9d3e73651
3 changed files with 24 additions and 5 deletions
+8 -3
View File
@@ -109,10 +109,15 @@ services:
- POSTGRES_DB=planka
- POSTGRES_HOST_AUTH_METHOD=trust
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres -d planka"]
interval: 10s
test:
[
"CMD-SHELL",
"pg_isready -U ${POSTGRES_USER:-postgres} -d ${POSTGRES_DB:-planka} && psql -U ${POSTGRES_USER:-postgres} -d ${POSTGRES_DB:-planka} -c 'SELECT 1'",
]
interval: 3s
timeout: 5s
retries: 5
retries: 15
start_period: 10s
volumes:
db-data: