From 6e24c0930751c9dbca4474eea1feabf1bb955a74 Mon Sep 17 00:00:00 2001 From: Kemboi Elvis Date: Mon, 18 May 2026 21:59:57 +0300 Subject: [PATCH] feat: update docker --- Dockerfile | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 1f60d9b..6e817df 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,11 @@ -FROM node:20-alpine AS builder +FROM node:22-alpine AS builder WORKDIR /app COPY package.json package-lock.json ./ RUN npm ci COPY . . RUN npm run build -FROM node:20-alpine AS runner +FROM node:22-alpine AS runner RUN addgroup --system --gid 1001 nodejs && \ adduser --system --uid 1001 finaflow WORKDIR /app @@ -14,9 +14,10 @@ COPY --from=builder /app/dist ./dist COPY --from=builder /app/db/migrations ./db/migrations COPY --from=builder /app/package.json ./ COPY --from=builder /app/drizzle.config.ts drizzle.config.ts +COPY --from=builder /app/scripts/run-migrations.ts scripts/run-migrations.ts USER finaflow EXPOSE 3000 -HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \ - CMD wget --no-verbose --tries=1 --spider http://localhost:3000/health || exit 1 -CMD ["node", "dist/boot.js"] +# HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \ +# CMD wget --no-verbose --tries=1 --spider http://localhost:3000/health || exit 1 +CMD ["sh", "-c", "npx tsx scripts/run-migrations.ts && node dist/boot.js"]