docker build works now

This commit is contained in:
Shihaam Abdul Rahman 2024-12-26 16:21:13 +05:00
parent 0f17800a00
commit 5fb6f52bfc
Signed by: shihaam
GPG Key ID: 6DA2E87EBC227636
4 changed files with 43 additions and 16 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -0,0 +1,5 @@
FROM oven/bun:1.1.42-debian
WORKDIR /var/www/html
CMD bunx prisma studio