Compare commits

..

No commits in common. "bf60df34efdcbcb38d46e648adfc628ae40208e6" and "62bd8811fafd33e186ac36e53aee2c02a0862fc1" have entirely different histories.

2 changed files with 13 additions and 21 deletions

View File

@ -9,13 +9,14 @@ RUN npx prisma generate && npm run build
FROM node:20-alpine
RUN mkdir -p /app/uploads && chown node:node /app/uploads
WORKDIR /app
COPY --chown=node:node --from=builder /app/package*.json ./
COPY --chown=node:node --from=builder /app/tsconfig.json ./tsconfig.json
COPY --chown=node:node --from=builder /app/node_modules ./node_modules
COPY --chown=node:node --from=builder /app/dist ./dist
COPY --chown=node:node --from=builder /app/prisma ./prisma
COPY --chown=node:node --from=builder /app/prisma/tsconfig.seed.json ./prisma/tsconfig.seed.json
COPY --chown=node:node --from=builder /app/prisma/scientificTerms.ts ./prisma/scientificTerms.ts
COPY --from=builder /app/package*.json ./
COPY --from=builder /app/tsconfig.json ./tsconfig.json
COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/dist ./dist
COPY --from=builder /app/prisma ./prisma
COPY --from=builder /app/prisma/tsconfig.seed.json ./prisma/tsconfig.seed.json
COPY --from=builder /app/prisma/scientificTerms.ts ./prisma/scientificTerms.ts
RUN chown -R node:node /app
ENV PRISMA_CLI_BINARY_TARGETS=linux-musl-openssl-3.0.x
EXPOSE 3000
USER node

View File

@ -499,20 +499,11 @@ export async function main() {
];
for (const b of blogs) {
try {
await prisma.blog.upsert({
where: { slug: b.slug },
update: {
title: b.title,
content: b.content,
isPublished: b.isPublished,
},
update: {},
create: b,
});
} catch (err: unknown) {
const msg = err instanceof Error ? err.message : String(err);
console.warn(`[Seed] Warning upserting blog ${b.slug}:`, msg);
}
}
console.log('Seeded blogs.');
}