This commit is contained in:
shafi54 2026-03-16 18:10:28 +05:30
parent 5d598b0752
commit 8f48ec39c2
6 changed files with 4018 additions and 24857 deletions

View file

@ -1,33 +1,34 @@
# Optimized Dockerfile for backend and fallback-ui services (project root)
# 1. ---- Base Node image
FROM node:20-slim AS base
# 1. ---- Base Bun image
FROM oven/bun:1.3.10 AS base
WORKDIR /app
# 2. ---- Pruner ----
FROM base AS pruner
WORKDIR /app
# Copy config files first for better caching
COPY package.json package-lock.json turbo.json ./
COPY package.json bun.lock turbo.json ./
COPY apps/backend/package.json ./apps/backend/
COPY apps/fallback-ui/package.json ./apps/fallback-ui/
COPY packages/shared/ ./packages/shared
COPY packages/ui/package.json ./packages/ui/
RUN npm install -g turbo
RUN bun install -g turbo
COPY . .
RUN turbo prune --scope=backend --scope=fallback-ui --scope=common-ui --scope=@packages/shared --docker
# 3. ---- Builder ----
FROM base AS builder
WORKDIR /app
# Copy package files first to cache npm install
# Copy package files first to cache bun install
COPY --from=pruner /app/out/json/ .
COPY --from=pruner /app/out/package-lock.json ./package-lock.json
COPY --from=pruner /app/out/bun.lock ./bun.lock
RUN cat ./bun.lock
COPY --from=pruner /app/turbo.json .
RUN npm ci
RUN bun install
# Copy source code after dependencies are installed
COPY --from=pruner /app/out/full/ .
RUN npx turbo run build --filter=fallback-ui... --filter=backend...
RUN bunx turbo run build --filter=fallback-ui... --filter=backend...
# 4. ---- Runner ----
FROM base AS runner
@ -35,14 +36,12 @@ WORKDIR /app
ENV NODE_ENV=production
# Copy package files and install production deps
COPY --from=pruner /app/out/json/ .
COPY --from=pruner /app/out/package-lock.json ./package-lock.json
RUN npm ci --production --omit=dev
COPY --from=pruner /app/out/bun.lock ./bun.lock
RUN bun install --production
# Copy built applications
COPY --from=builder /app/apps/backend/dist ./apps/backend/dist
COPY --from=builder /app/apps/fallback-ui/dist ./apps/fallback-ui/dist
COPY --from=builder /app/packages/shared ./packages/shared
EXPOSE 4000
RUN npm i -g bun
CMD ["bun", "apps/backend/dist/index.js"]
# CMD ["node", "apps/backend/dist/index.js"]

View file

@ -42,7 +42,6 @@
"multer": "^2.0.2",
"node-cron": "^4.2.1",
"pg": "^8.16.3",
"pg-sdk-node": "https://phonepe.mycloudrepo.io/public/repositories/phonepe-pg-sdk-node/releases/v2/phonepe-pg-sdk-node.tgz",
"razorpay": "^2.9.6",
"redis": "^5.9.0",
"zod": "^4.1.12"

4004
bun.lock Normal file

File diff suppressed because it is too large Load diff

24841
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -2,7 +2,7 @@
"name": "meat-farmer-monorepo",
"version": "1.0.0",
"private": true,
"packageManager": "npm@10.8.1",
"packageManager": "bun@1.3.10",
"scripts": {
"build": "turbo run build",
"dev": "turbo run dev --parallel",

View file

@ -64,8 +64,8 @@ const isDevMode = Constants.executionEnvironment !== "standalone";
// const BASE_API_URL = 'http://10.0.2.2:4000';
// const BASE_API_URL = 'http://192.168.100.101:4000';
// const BASE_API_URL = 'http://192.168.1.5:4000';
let BASE_API_URL = "https://mf.freshyo.in";
// let BASE_API_URL = "https://freshyo.technocracy.ovh";
// let BASE_API_URL = "https://mf.freshyo.in";
let BASE_API_URL = "https://freshyo.technocracy.ovh";
// let BASE_API_URL = 'http://192.168.100.107:4000';
// let BASE_API_URL = 'http://192.168.29.176:4000';