Slim down server compose: entrypoint roles, self-migrating image

- docker-entrypoint.sh: `web` (default) or `worker`; both apply pending
  migrations under a flock on /data, so no start-order dependency
- docker-healthcheck.sh baked into the image for both roles
- deploy/compose.yaml reduced to image, role, env file, volumes, port
- dist/migrate.mjs bundled alongside the worker

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Pascal LinxweilerandClaude Opus 5.5 committed 2026-10-05 17:30:49 +02:00
1 parent 30b01d7bca
commit fbcdcf2e2d
8 files changed
+65 -72

No files matched your search

+5 -2
View File
@@ -1,4 +1,4 @@
# One image for both services: `web` (next start) and `worker` (node dist/worker.mjs).
# One image for both services; the first argument picks the role: `web` (default) or `worker`.
FROM node:24-trixie-slim AS node
@@ -46,7 +46,10 @@ COPY --from=build --chown=app:app /app/node_modules ./node_modules
COPY --from=build --chown=app:app /app/.next ./.next
COPY --from=build --chown=app:app /app/dist ./dist
COPY --from=build --chown=app:app /app/drizzle ./drizzle
COPY --chmod=755 docker-entrypoint.sh docker-healthcheck.sh /usr/local/bin/
USER app
EXPOSE 3000
CMD ["node_modules/.bin/next", "start"]
HEALTHCHECK --interval=15s --timeout=5s --start-period=30s --retries=3 CMD ["docker-healthcheck.sh"]
ENTRYPOINT ["docker-entrypoint.sh"]
CMD ["web"]