Update Dockerfile and docker-compose.yml to change application port to 6060; add health check endpoint. Add cookie dependency to package.json and create health check API endpoint.

This commit is contained in:
2025-08-06 14:57:19 +02:00
parent d0075f5b12
commit ae928bbb9b
5 changed files with 43 additions and 7 deletions

View File

@@ -8,8 +8,8 @@ WORKDIR /app
# Copy package files
COPY package*.json ./
# Install dependencies
RUN npm ci --only=production && npm cache clean --force
# Install all dependencies (including dev dependencies for build)
RUN npm install && npm cache clean --force
# Copy source code
COPY . .
@@ -44,11 +44,11 @@ RUN mkdir -p /app/data && chown nuxt:nodejs /app/data
USER nuxt
# Expose port
EXPOSE 3000
EXPOSE 6060
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
CMD node -e "require('http').get('http://localhost:3000/api/health', (r) => {r.statusCode === 200 ? process.exit(0) : process.exit(1)})" || exit 1
CMD node -e "require('http').get('http://localhost:6060/api/health', (r) => {r.statusCode === 200 ? process.exit(0) : process.exit(1)})" || exit 1
# Use dumb-init to handle signals properly
ENTRYPOINT ["dumb-init", "--"]