mirror of
https://github.com/i701/sarlink-portal.git
synced 2025-02-20 19:42:00 +00:00
optimize container build
Some checks failed
Build and Push Docker Images / Build and Push Docker Images (push) Failing after 1m36s
Some checks failed
Build and Push Docker Images / Build and Push Docker Images (push) Failing after 1m36s
This commit is contained in:
parent
fe3161ead9
commit
0e6f405ec4
@ -1,29 +1,18 @@
|
||||
FROM oven/bun:1.1.42-debian AS builder
|
||||
WORKDIR /var/www/html
|
||||
|
||||
ENV NEXT_TELEMETRY_DISABLED=1
|
||||
ENV DATABASE_URL="postgresql://dummy:dummy@dummy:5432/dummy"
|
||||
|
||||
COPY package.json package-lock.json ./
|
||||
COPY prisma ./prisma/
|
||||
|
||||
RUN bun install --frozen-lockfile
|
||||
|
||||
RUN bunx prisma generate
|
||||
|
||||
COPY . .
|
||||
|
||||
RUN bun install --frozen-lockfile
|
||||
RUN bunx prisma generate
|
||||
RUN bun run build
|
||||
|
||||
FROM oven/bun:1.1.42-debian
|
||||
WORKDIR /var/www/html
|
||||
|
||||
COPY --from=builder /var/www/html/package.json ./
|
||||
COPY --from=builder /var/www/html/node_modules ./node_modules
|
||||
COPY --from=builder /var/www/html/.next ./.next
|
||||
COPY --from=builder /var/www/html/public ./public
|
||||
COPY --from=builder /var/www/html/prisma ./prisma
|
||||
|
||||
VOLUME /var/www/html
|
||||
|
||||
CMD bun start
|
||||
CMD ["bun", "start"]
|
||||
|
10
.dockerignore
Normal file
10
.dockerignore
Normal file
@ -0,0 +1,10 @@
|
||||
.git
|
||||
.next
|
||||
node_modules
|
||||
npm-debug.log
|
||||
README.md
|
||||
.env*
|
||||
.dockerignore
|
||||
Dockerfile
|
||||
docker-compose.yml
|
||||
compose.yml
|
@ -4,11 +4,12 @@
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "next dev --turbopack",
|
||||
"build": "bunx prisma migrate deploy && bunx prisma generate && bunx prisma db push && next build",
|
||||
"build": "next build",
|
||||
"start": "next start",
|
||||
"lint": "next lint",
|
||||
"studio": "bunx prisma studio",
|
||||
"push": "bunx prisma db push"
|
||||
"push": "bunx prisma db push",
|
||||
"db-setup": "bunx prisma migrate deploy && bunx prisma generate && bunx prisma db push"
|
||||
},
|
||||
"prisma": {
|
||||
"seed": "ts-node --compiler-options {\"module\":\"CommonJS\"} prisma/seed.ts"
|
||||
@ -66,4 +67,4 @@
|
||||
"ts-node": "^10.9.2",
|
||||
"typescript": "^5.7.2"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user