AriaieBOY 2022-06-27 21:39:08 +04:30
parent a37dd6180b
commit 10fb001d04
5 changed files with 7305 additions and 4497 deletions

View File

@ -25,7 +25,6 @@ ENV DISABLE_LOGIN $DISABLE_LOGIN
ENV NEXT_TELEMETRY_DISABLED 1 ENV NEXT_TELEMETRY_DISABLED 1
RUN yarn build RUN yarn build
# Production image, copy all the files and run next # Production image, copy all the files and run next
FROM node:16-alpine AS runner FROM node:16-alpine AS runner
WORKDIR /app WORKDIR /app
@ -36,8 +35,10 @@ ENV NEXT_TELEMETRY_DISABLED 1
RUN addgroup --system --gid 1001 nodejs RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nextjs RUN adduser --system --uid 1001 nextjs
RUN yarn global add prisma RUN yarn global add prisma @prisma/client npm-run-all
# Copy Scripts to the production
COPY --from=builder /app/scripts/check-db-bundle.js ./scripts/check-db.js
# You only need to copy next.config.js if you are NOT using the default configuration # You only need to copy next.config.js if you are NOT using the default configuration
COPY --from=builder /app/next.config.js ./ COPY --from=builder /app/next.config.js ./
COPY --from=builder /app/public ./public COPY --from=builder /app/public ./public

View File

@ -11,7 +11,7 @@
}, },
"scripts": { "scripts": {
"dev": "next dev", "dev": "next dev",
"build": "npm-run-all build-tracker build-geo build-db build-app", "build": "npm-run-all build-tracker build-checkdb build-geo build-db build-app",
"start": "npm-run-all check-db start-next", "start": "npm-run-all check-db start-next",
"start-docker": "npm-run-all check-db start-server", "start-docker": "npm-run-all check-db start-server",
"start-env": "node -r dotenv/config scripts/start-env.js", "start-env": "node -r dotenv/config scripts/start-env.js",
@ -19,6 +19,7 @@
"start-next": "next start", "start-next": "next start",
"build-app": "next build", "build-app": "next build",
"build-tracker": "rollup -c rollup.tracker.config.js", "build-tracker": "rollup -c rollup.tracker.config.js",
"build-checkdb": "rollup -c rollup.checkdb.config.js",
"build-db": "npm-run-all copy-db-files build-db-client", "build-db": "npm-run-all copy-db-files build-db-client",
"build-lang": "npm-run-all format-lang compile-lang", "build-lang": "npm-run-all format-lang compile-lang",
"build-geo": "node scripts/build-geo.js", "build-geo": "node scripts/build-geo.js",
@ -102,6 +103,8 @@
"devDependencies": { "devDependencies": {
"@formatjs/cli": "^4.2.29", "@formatjs/cli": "^4.2.29",
"@rollup/plugin-buble": "^0.21.3", "@rollup/plugin-buble": "^0.21.3",
"@rollup/plugin-commonjs": "^22.0.1",
"@rollup/plugin-node-resolve": "^13.3.0",
"@svgr/webpack": "^6.2.1", "@svgr/webpack": "^6.2.1",
"cross-env": "^7.0.3", "cross-env": "^7.0.3",
"eslint": "^7.32.0", "eslint": "^7.32.0",

10
rollup.checkdb.config.js Normal file
View File

@ -0,0 +1,10 @@
import commonjs from "@rollup/plugin-commonjs";
import { nodeResolve } from '@rollup/plugin-node-resolve';
export default {
input: 'scripts/check-db.js',
output: {
file: 'scripts/check-db-bundle.js',
format: 'cjs',
},
plugins: [commonjs(),nodeResolve()],
};

View File

@ -1,8 +1,9 @@
require('dotenv').config(); import dotenv from 'dotenv';
dotenv.config();
const { PrismaClient } = require('@prisma/client'); const { PrismaClient } = require('@prisma/client');
const prisma = new PrismaClient(); const prisma = new PrismaClient();
const chalk = require('chalk'); import chalk from 'chalk';
const spawn = require('cross-spawn'); import spawn from 'cross-spawn';
let message = ''; let message = '';
const updateMessage = `To update your database, you need to run:\n${chalk.bold.whiteBright( const updateMessage = `To update your database, you need to run:\n${chalk.bold.whiteBright(

11775
yarn.lock

File diff suppressed because it is too large Load Diff