mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2025-11-10 12:32:28 +10:00
ci(dockerfile): copy prisma client correctly
This commit is contained in:
4
.github/workflows/publish-docker-image.yml
vendored
4
.github/workflows/publish-docker-image.yml
vendored
@ -6,6 +6,10 @@ on:
|
|||||||
branches:
|
branches:
|
||||||
- v4
|
- v4
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
env:
|
env:
|
||||||
IMAGE: amruthpillai/reactive-resume
|
IMAGE: amruthpillai/reactive-resume
|
||||||
|
|
||||||
|
|||||||
1
.gitignore
vendored
1
.gitignore
vendored
@ -39,6 +39,7 @@ Thumbs.db
|
|||||||
# Generated Files
|
# Generated Files
|
||||||
.nx
|
.nx
|
||||||
stats.html
|
stats.html
|
||||||
|
libs/prisma
|
||||||
|
|
||||||
# Environment Variables
|
# Environment Variables
|
||||||
*.env*
|
*.env*
|
||||||
5
.npmrc
5
.npmrc
@ -1,3 +1,6 @@
|
|||||||
auto-install-peers=true
|
auto-install-peers=true
|
||||||
enable-pre-post-scripts=true
|
enable-pre-post-scripts=true
|
||||||
strict-peer-dependencies=false
|
strict-peer-dependencies=false
|
||||||
|
public-hoist-pattern[]=*eslint*
|
||||||
|
public-hoist-pattern[]=*prisma*
|
||||||
|
public-hoist-pattern[]=*prettier*
|
||||||
10
Dockerfile
10
Dockerfile
@ -9,19 +9,15 @@ ENV PATH="$PNPM_HOME:$PATH"
|
|||||||
|
|
||||||
RUN corepack enable
|
RUN corepack enable
|
||||||
|
|
||||||
RUN apt update && apt install -y build-essential --no-install-recommends
|
|
||||||
|
|
||||||
# --- Build Image ---
|
# --- Build Image ---
|
||||||
FROM base AS build
|
FROM base AS build
|
||||||
|
|
||||||
ENV PUPPETEER_SKIP_DOWNLOAD true
|
|
||||||
ENV NX_CLOUD_ACCESS_TOKEN=$NX_CLOUD_ACCESS_TOKEN
|
ENV NX_CLOUD_ACCESS_TOKEN=$NX_CLOUD_ACCESS_TOKEN
|
||||||
|
|
||||||
COPY .npmrc package.json pnpm-lock.yaml ./
|
COPY .npmrc package.json pnpm-lock.yaml ./
|
||||||
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
|
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
|
||||||
|
|
||||||
COPY . .
|
COPY . .
|
||||||
RUN pnpm prisma generate
|
|
||||||
|
|
||||||
RUN pnpm build
|
RUN pnpm build
|
||||||
|
|
||||||
@ -33,18 +29,12 @@ RUN apt update && apt install -y dumb-init --no-install-recommends
|
|||||||
COPY --chown=node:node --from=build /app/dist ./dist
|
COPY --chown=node:node --from=build /app/dist ./dist
|
||||||
COPY --chown=node:node --from=build /app/.npmrc /app/package.json /app/pnpm-lock.yaml ./
|
COPY --chown=node:node --from=build /app/.npmrc /app/package.json /app/pnpm-lock.yaml ./
|
||||||
|
|
||||||
ENV PUPPETEER_SKIP_DOWNLOAD true
|
|
||||||
|
|
||||||
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm add --global husky
|
|
||||||
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --prod --frozen-lockfile
|
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --prod --frozen-lockfile
|
||||||
|
|
||||||
# Copy Prisma Generated Client
|
# Copy Prisma Generated Client
|
||||||
COPY --chown=node:node --from=build ./app/node_modules/.pnpm/@prisma+client* ./node_modules/.pnpm/
|
COPY --chown=node:node --from=build ./app/node_modules/.pnpm/@prisma+client* ./node_modules/.pnpm/
|
||||||
COPY --chown=node:node --from=build ./app/node_modules/@prisma/client ./node_modules/@prisma/client
|
|
||||||
|
|
||||||
# Copy Prisma Schema & Migrations
|
# Copy Prisma Schema & Migrations
|
||||||
COPY --chown=node:node --from=build ./app/tools/prisma ./tools/prisma
|
COPY --chown=node:node --from=build ./app/tools/prisma ./tools/prisma
|
||||||
|
|
||||||
ENV NODE_ENV production
|
|
||||||
|
|
||||||
CMD [ "dumb-init", "pnpm", "start" ]
|
CMD [ "dumb-init", "pnpm", "start" ]
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import { z } from "nestjs-zod/z";
|
import { z } from "nestjs-zod/z";
|
||||||
|
|
||||||
export const configSchema = z.object({
|
export const configSchema = z.object({
|
||||||
NODE_ENV: z.enum(["development", "production"]).default("development"),
|
NODE_ENV: z.enum(["development", "production"]).default("production"),
|
||||||
|
|
||||||
// Ports
|
// Ports
|
||||||
PORT: z.coerce.number().default(3000),
|
PORT: z.coerce.number().default(3000),
|
||||||
|
|||||||
@ -17,16 +17,12 @@ import { Config } from "@/server/config/schema";
|
|||||||
useFactory: async (configService: ConfigService<Config>) => ({
|
useFactory: async (configService: ConfigService<Config>) => ({
|
||||||
prismaOptions: { datasourceUrl: configService.get("DATABASE_URL") },
|
prismaOptions: { datasourceUrl: configService.get("DATABASE_URL") },
|
||||||
middlewares: [
|
middlewares: [
|
||||||
...(configService.get("NODE_ENV") === "development"
|
loggingMiddleware({
|
||||||
? [
|
logLevel: "debug", // only in development
|
||||||
loggingMiddleware({
|
logger: new Logger(PrismaService.name),
|
||||||
logLevel: "debug",
|
logMessage: (query) =>
|
||||||
logger: new Logger(PrismaService.name),
|
`[Query] ${query.model}.${query.action} - ${query.executionTime}ms`,
|
||||||
logMessage: (query) =>
|
}),
|
||||||
`[Query] ${query.model}.${query.action} - ${query.executionTime}ms`,
|
|
||||||
}),
|
|
||||||
]
|
|
||||||
: []),
|
|
||||||
],
|
],
|
||||||
}),
|
}),
|
||||||
}),
|
}),
|
||||||
|
|||||||
@ -164,7 +164,7 @@
|
|||||||
"@songkeys/nestjs-redis": "^10.0.0",
|
"@songkeys/nestjs-redis": "^10.0.0",
|
||||||
"@songkeys/nestjs-redis-health": "^10.0.0",
|
"@songkeys/nestjs-redis-health": "^10.0.0",
|
||||||
"@swc/helpers": "~0.5.3",
|
"@swc/helpers": "~0.5.3",
|
||||||
"@tanstack/react-query": "^5.7.0",
|
"@tanstack/react-query": "^5.7.1",
|
||||||
"@tiptap/extension-highlight": "^2.1.12",
|
"@tiptap/extension-highlight": "^2.1.12",
|
||||||
"@tiptap/extension-image": "^2.1.12",
|
"@tiptap/extension-image": "^2.1.12",
|
||||||
"@tiptap/extension-link": "^2.1.12",
|
"@tiptap/extension-link": "^2.1.12",
|
||||||
|
|||||||
8
pnpm-lock.yaml
generated
8
pnpm-lock.yaml
generated
@ -153,8 +153,8 @@ dependencies:
|
|||||||
specifier: ~0.5.3
|
specifier: ~0.5.3
|
||||||
version: 0.5.3
|
version: 0.5.3
|
||||||
'@tanstack/react-query':
|
'@tanstack/react-query':
|
||||||
specifier: ^5.7.0
|
specifier: ^5.7.1
|
||||||
version: 5.7.0(react-dom@18.2.0)(react@18.2.0)
|
version: 5.7.1(react-dom@18.2.0)(react@18.2.0)
|
||||||
'@tiptap/extension-highlight':
|
'@tiptap/extension-highlight':
|
||||||
specifier: ^2.1.12
|
specifier: ^2.1.12
|
||||||
version: 2.1.12(@tiptap/core@2.1.12)
|
version: 2.1.12(@tiptap/core@2.1.12)
|
||||||
@ -6385,8 +6385,8 @@ packages:
|
|||||||
resolution: {integrity: sha512-fnI9ORjcuLGm1sNrKatKIosRQUpuqcD4SV7RqRSVmj8JSicX2aoMyKryHEBpVQvf6N4PaBVgBxQomjsbsGPssQ==}
|
resolution: {integrity: sha512-fnI9ORjcuLGm1sNrKatKIosRQUpuqcD4SV7RqRSVmj8JSicX2aoMyKryHEBpVQvf6N4PaBVgBxQomjsbsGPssQ==}
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
/@tanstack/react-query@5.7.0(react-dom@18.2.0)(react@18.2.0):
|
/@tanstack/react-query@5.7.1(react-dom@18.2.0)(react@18.2.0):
|
||||||
resolution: {integrity: sha512-f6F9OdW4MC0bwlYPXop114ngkkZtg650TeJpR2/ME9q/iJ/59dg2+LoGHEdHk2w1mNAdiuiPFYzCcl2WNkFiiw==}
|
resolution: {integrity: sha512-7onwx519jOKh7/nspf70dOSejJSYfhFRnVsSicuPrmO8L6Iw05G1wwDpp1PjqFLsm7suixlHDXhcNfK0sy0kWg==}
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
react: ^18.0.0
|
react: ^18.0.0
|
||||||
react-dom: ^18.0.0
|
react-dom: ^18.0.0
|
||||||
|
|||||||
@ -55,8 +55,6 @@ services:
|
|||||||
app:
|
app:
|
||||||
image: amruthpillai/reactive-resume
|
image: amruthpillai/reactive-resume
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
ports:
|
|
||||||
- 3000:3000
|
|
||||||
depends_on:
|
depends_on:
|
||||||
- postgres
|
- postgres
|
||||||
- minio
|
- minio
|
||||||
@ -112,7 +110,6 @@ services:
|
|||||||
- --entrypoints.web.address=:80
|
- --entrypoints.web.address=:80
|
||||||
ports:
|
ports:
|
||||||
- 80:80
|
- 80:80
|
||||||
- 8080:8080
|
|
||||||
volumes:
|
volumes:
|
||||||
- /var/run/docker.sock:/var/run/docker.sock
|
- /var/run/docker.sock:/var/run/docker.sock
|
||||||
|
|
||||||
|
|||||||
@ -1,7 +0,0 @@
|
|||||||
const fs = require("fs");
|
|
||||||
const path = require("path");
|
|
||||||
|
|
||||||
const packageJsonPath = path.join(__dirname, "..", "..", "package.json");
|
|
||||||
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, "utf-8"));
|
|
||||||
|
|
||||||
process.stdout.write(packageJson.version);
|
|
||||||
@ -15,8 +15,10 @@
|
|||||||
"skipDefaultLibCheck": true,
|
"skipDefaultLibCheck": true,
|
||||||
"baseUrl": ".",
|
"baseUrl": ".",
|
||||||
"paths": {
|
"paths": {
|
||||||
|
// App Paths
|
||||||
"@/client/*": ["apps/client/src/*"],
|
"@/client/*": ["apps/client/src/*"],
|
||||||
"@/server/*": ["apps/server/src/*"],
|
"@/server/*": ["apps/server/src/*"],
|
||||||
|
// Library Paths
|
||||||
"@reactive-resume/dto": ["libs/dto/src/index.ts"],
|
"@reactive-resume/dto": ["libs/dto/src/index.ts"],
|
||||||
"@reactive-resume/hooks": ["libs/hooks/src/index.ts"],
|
"@reactive-resume/hooks": ["libs/hooks/src/index.ts"],
|
||||||
"@reactive-resume/parser": ["libs/parser/src/index.ts"],
|
"@reactive-resume/parser": ["libs/parser/src/index.ts"],
|
||||||
|
|||||||
Reference in New Issue
Block a user