add seeding
This commit is contained in:
parent
2346fe4879
commit
970865c7a4
3 changed files with 21 additions and 7 deletions
24
Dockerfile
24
Dockerfile
|
@ -1,22 +1,32 @@
|
|||
FROM oven/bun:alpine
|
||||
FROM docker.io/oven/bun:alpine AS base
|
||||
|
||||
ENV NODE_ENV=production
|
||||
|
||||
WORKDIR /app
|
||||
RUN chown -R bun:bun /app
|
||||
USER bun
|
||||
|
||||
COPY bun.lock ./
|
||||
COPY package.json ./
|
||||
COPY tsconfig.build.json ./
|
||||
COPY tsconfig.json ./
|
||||
COPY package.json ./
|
||||
COPY bun.lock ./
|
||||
|
||||
RUN bun install --production --frozen-lockfile
|
||||
RUN bun install --ignore-scripts --production --frozen-lockfile
|
||||
|
||||
FROM base AS builder
|
||||
|
||||
COPY prisma ./prisma/
|
||||
RUN bunx prisma generate
|
||||
|
||||
COPY . .
|
||||
|
||||
ENV NODE_ENV=production
|
||||
|
||||
RUN bun run build
|
||||
|
||||
FROM base AS runner
|
||||
|
||||
COPY --from=builder /app/dist ./dist
|
||||
COPY --from=builder /app/prisma ./prisma
|
||||
|
||||
EXPOSE 4000
|
||||
|
||||
CMD bunx prisma migrate deploy && bunx prisma db seed && bun run start:prod
|
||||
CMD bun prisma migrate deploy && bun run start:prod
|
||||
|
|
|
@ -10,8 +10,12 @@
|
|||
"start": "bun --bun nest start",
|
||||
"start:dev": "bun --hot ./src/app.ts",
|
||||
"start:prod": "bun dist/app",
|
||||
"lint": "eslint .",
|
||||
"lint:fix": "eslint . --fix"
|
||||
},
|
||||
"prisma": {
|
||||
"seed": "bun ./prisma/seed.ts"
|
||||
}
|
||||
"dependencies": {
|
||||
"@fastify/helmet": "^13.0.1",
|
||||
"@fastify/multipart": "^9.0.3",
|
||||
|
|
0
prisma/seed.ts
Normal file
0
prisma/seed.ts
Normal file
Loading…
Add table
Reference in a new issue