Compare commits
No commits in common. "bf60df34efdcbcb38d46e648adfc628ae40208e6" and "62bd8811fafd33e186ac36e53aee2c02a0862fc1" have entirely different histories.
bf60df34ef
...
62bd8811fa
@ -9,13 +9,14 @@ RUN npx prisma generate && npm run build
|
|||||||
FROM node:20-alpine
|
FROM node:20-alpine
|
||||||
RUN mkdir -p /app/uploads && chown node:node /app/uploads
|
RUN mkdir -p /app/uploads && chown node:node /app/uploads
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY --chown=node:node --from=builder /app/package*.json ./
|
COPY --from=builder /app/package*.json ./
|
||||||
COPY --chown=node:node --from=builder /app/tsconfig.json ./tsconfig.json
|
COPY --from=builder /app/tsconfig.json ./tsconfig.json
|
||||||
COPY --chown=node:node --from=builder /app/node_modules ./node_modules
|
COPY --from=builder /app/node_modules ./node_modules
|
||||||
COPY --chown=node:node --from=builder /app/dist ./dist
|
COPY --from=builder /app/dist ./dist
|
||||||
COPY --chown=node:node --from=builder /app/prisma ./prisma
|
COPY --from=builder /app/prisma ./prisma
|
||||||
COPY --chown=node:node --from=builder /app/prisma/tsconfig.seed.json ./prisma/tsconfig.seed.json
|
COPY --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/prisma/scientificTerms.ts ./prisma/scientificTerms.ts
|
||||||
|
RUN chown -R node:node /app
|
||||||
ENV PRISMA_CLI_BINARY_TARGETS=linux-musl-openssl-3.0.x
|
ENV PRISMA_CLI_BINARY_TARGETS=linux-musl-openssl-3.0.x
|
||||||
EXPOSE 3000
|
EXPOSE 3000
|
||||||
USER node
|
USER node
|
||||||
|
|||||||
@ -499,20 +499,11 @@ export async function main() {
|
|||||||
];
|
];
|
||||||
|
|
||||||
for (const b of blogs) {
|
for (const b of blogs) {
|
||||||
try {
|
await prisma.blog.upsert({
|
||||||
await prisma.blog.upsert({
|
where: { slug: b.slug },
|
||||||
where: { slug: b.slug },
|
update: {},
|
||||||
update: {
|
create: b,
|
||||||
title: b.title,
|
});
|
||||||
content: b.content,
|
|
||||||
isPublished: b.isPublished,
|
|
||||||
},
|
|
||||||
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.');
|
console.log('Seeded blogs.');
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user