diff --git a/.build/prod/Dockerfile b/.build/prod/Dockerfile deleted file mode 100644 index 574e79d..0000000 --- a/.build/prod/Dockerfile +++ /dev/null @@ -1,13 +0,0 @@ -FROM node:18 - -# Use bash as the default shell -SHELL ["/bin/bash", "-c"] - -ENV NODE_ENV=production - -WORKDIR /var/www/html -COPY .. /var/www/html - -RUN yarn install && yarn build - -CMD yarn start diff --git a/.build/prod/bun.Dockerfile b/.build/prod/bun.Dockerfile new file mode 100644 index 0000000..bd9bb03 --- /dev/null +++ b/.build/prod/bun.Dockerfile @@ -0,0 +1,29 @@ +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 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 diff --git a/.build/prod/compose.yml b/.build/prod/compose.yml index 787e62a..cd07c4d 100644 --- a/.build/prod/compose.yml +++ b/.build/prod/compose.yml @@ -1,7 +1,13 @@ services: - node: + app: build: context: ../../ - dockerfile: .build/prod/Dockerfile + dockerfile: .build/prod/bun.Dockerfile hostname: sarlink-portal - image: git.shihaam.dev/sarlink/sarlink-portal + image: git.shihaam.dev/sarlink/sarlink-portal/app + prisma-studio: + build: + context: . + dockerfile: ./prisma.Dockerfile + hostname: sarlink-portal-database-ui + image: git.shihaam.dev/sarlink/sarlink-portal/prisma-studio diff --git a/.build/prod/prisma.Dockerfile b/.build/prod/prisma.Dockerfile new file mode 100644 index 0000000..a01f725 --- /dev/null +++ b/.build/prod/prisma.Dockerfile @@ -0,0 +1,5 @@ +FROM oven/bun:1.1.42-debian + +WORKDIR /var/www/html + +CMD bunx prisma studio