amke hot reload work for node app

This commit is contained in:
counterweight 2025-02-19 18:49:10 +01:00
parent 2ae502e790
commit c3e363fb9b
Signed by: counterweight
GPG key ID: 883EDBAA726BD96C
3 changed files with 6 additions and 1 deletions

View file

@ -10,6 +10,9 @@ RUN echo "listen_addresses='*'" >> /etc/postgresql/15/main/postgresql.conf && \
echo "host all all 0.0.0.0/0 md5" >> /etc/postgresql/15/main/pg_hba.conf && \ echo "host all all 0.0.0.0/0 md5" >> /etc/postgresql/15/main/pg_hba.conf && \
echo "host all all ::/0 md5" >> /etc/postgresql/15/main/pg_hba.conf echo "host all all ::/0 md5" >> /etc/postgresql/15/main/pg_hba.conf
RUN npm install -g nodemon
# Set up working directory for Express app # Set up working directory for Express app
WORKDIR /app WORKDIR /app
COPY package*.json ./ COPY package*.json ./

View file

@ -12,3 +12,5 @@ services:
- POSTGRES_USER=${POSTGRES_USER} - POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD} - POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_DB=${POSTGRES_DB} - POSTGRES_DB=${POSTGRES_DB}
volumes:
- .:/app

View file

@ -20,7 +20,7 @@ su - postgres -c "psql -c \"CREATE DATABASE $POSTGRES_DB OWNER $POSTGRES_USER;\"
caddy run --config /etc/caddy/Caddyfile & caddy run --config /etc/caddy/Caddyfile &
# Start Express app # Start Express app
npm start exec nodemon src/app.js
# Keep container running # Keep container running
wait wait