mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-18 20:21:24 +02:00
fix(picture): fix health endpoint and port consistency for Docker deployment
Exclude /health from global prefix so healthchecks hit /health instead of /api/v1/health. Update Dockerfile EXPOSE and healthcheck to use port 3040 matching docker-compose config. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
15cde622e4
commit
887b60c8c1
3 changed files with 9 additions and 7 deletions
|
|
@ -84,12 +84,12 @@ RUN chmod +x /usr/local/bin/docker-entrypoint.sh
|
|||
|
||||
WORKDIR /app/apps/picture/apps/backend
|
||||
|
||||
# Expose port
|
||||
EXPOSE 3006
|
||||
# Expose port (overridden by PORT env var in docker-compose)
|
||||
EXPOSE 3040
|
||||
|
||||
# Health check
|
||||
# Health check (overridden by docker-compose healthcheck)
|
||||
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
|
||||
CMD wget --no-verbose --tries=1 --spider http://localhost:3006/api/health || exit 1
|
||||
CMD wget --no-verbose --tries=1 --spider http://localhost:${PORT:-3040}/health || exit 1
|
||||
|
||||
# Run entrypoint script
|
||||
ENTRYPOINT ["docker-entrypoint.sh"]
|
||||
|
|
|
|||
|
|
@ -47,8 +47,10 @@ async function bootstrap() {
|
|||
prefix: '/uploads/',
|
||||
});
|
||||
|
||||
// Set global prefix for API routes
|
||||
app.setGlobalPrefix('api/v1');
|
||||
// Set global prefix for API routes, exclude health/metrics
|
||||
app.setGlobalPrefix('api/v1', {
|
||||
exclude: ['health', 'metrics'],
|
||||
});
|
||||
|
||||
const port = process.env.PORT || 3006;
|
||||
await app.listen(port);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue