Update docker build.

This commit is contained in:
Mike Cao 2022-06-27 10:34:03 -07:00
parent a37dd6180b
commit 6541ba1ab4
5 changed files with 9 additions and 28 deletions

View File

@ -37,13 +37,14 @@ RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nextjs
RUN yarn global add prisma
RUN yarn add npm-run-all dotenv
# 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/package.json ./package.json
COPY --from=builder /app/prisma/schema.prisma ./prisma/schema.prisma
COPY --from=builder /app/prisma/migrations ./prisma/migrations
COPY --from=builder /app/prisma ./prisma
COPY --from=builder /app/scripts ./scripts
# Automatically leverage output traces to reduce image size
# https://nextjs.org/docs/advanced-features/output-file-tracing

View File

@ -14,7 +14,7 @@
"build": "npm-run-all build-tracker build-geo build-db build-app",
"start": "npm-run-all check-db start-next",
"start-docker": "npm-run-all check-db start-server",
"start-env": "node -r dotenv/config scripts/start-env.js",
"start-env": "node scripts/start-env.js",
"start-server": "node server.js",
"start-next": "next start",
"build-app": "next build",
@ -68,7 +68,6 @@
"del": "^6.0.0",
"detect-browser": "^5.2.0",
"dotenv": "^10.0.0",
"dotenv-cli": "^4.0.0",
"formik": "^2.2.9",
"fs-extra": "^10.0.1",
"immer": "^9.0.12",

View File

@ -5,11 +5,11 @@ const chalk = require('chalk');
const spawn = require('cross-spawn');
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.yellow(
'yarn update-db',
)}`;
const baselineMessage = cmd =>
`You need to update your database by running:\n${chalk.bold.whiteBright(cmd)}`;
`You need to update your database by running:\n${chalk.bold.yellow(cmd)}`;
function success(msg) {
console.log(chalk.greenBright(`${msg}`));

View File

@ -1,3 +1,4 @@
require('dotenv').config();
const cli = require('next/dist/cli/next-start');
cli.nextStart(['-p', process.env.PORT || 3000, '-H', process.env.HOSTNAME || '0.0.0.0']);

View File

@ -2785,31 +2785,11 @@ domutils@^2.8.0:
domelementtype "^2.2.0"
domhandler "^4.2.0"
dotenv-cli@^4.0.0:
version "4.1.1"
resolved "https://registry.yarnpkg.com/dotenv-cli/-/dotenv-cli-4.1.1.tgz#26a59fbb25876008985a15fa366b416607e8372c"
integrity sha512-XvKv1pa+UBrsr3CtLGBsR6NdsoS7znqaHUf4Knj0eZO+gOI/hjj9KgWDP+KjpfEbj6wAba1UpbhaP9VezNkWhg==
dependencies:
cross-spawn "^7.0.1"
dotenv "^8.1.0"
dotenv-expand "^5.1.0"
minimist "^1.1.3"
dotenv-expand@^5.1.0:
version "5.1.0"
resolved "https://registry.yarnpkg.com/dotenv-expand/-/dotenv-expand-5.1.0.tgz#3fbaf020bfd794884072ea26b1e9791d45a629f0"
integrity sha512-YXQl1DSa4/PQyRfgrv6aoNjhasp/p4qs9FjJ4q4cQk+8m4r6k4ZSiEyytKG8f8W9gi8WsQtIObNmKd+tMzNTmA==
dotenv@^10.0.0:
version "10.0.0"
resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-10.0.0.tgz#3d4227b8fb95f81096cdd2b66653fb2c7085ba81"
integrity sha512-rlBi9d8jpv9Sf1klPjNfFAuWDjKLwTIJJ/VxtoTwIR6hnZxcEOQCZg2oIL3MWBYw5GpUDKOEnND7LXTbIpQ03Q==
dotenv@^8.1.0:
version "8.6.0"
resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-8.6.0.tgz#061af664d19f7f4d8fc6e4ff9b584ce237adcb8b"
integrity sha512-IrPdXQsk2BbzvCBGBOTmmSH5SodmqZNt4ERAZDmW4CT+tL8VtvinqywuANaFu4bOMWki16nqf0e4oC0QIaDr/g==
electron-to-chromium@^1.4.118, electron-to-chromium@^1.4.84:
version "1.4.143"
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.143.tgz#10f1bb595ad6cd893c05097039c685dcf5c8e30c"
@ -4314,7 +4294,7 @@ minimist-options@4.1.0, minimist-options@^4.0.2:
is-plain-obj "^1.1.0"
kind-of "^6.0.3"
minimist@^1.1.3, minimist@^1.2.0, minimist@^1.2.5, minimist@^1.2.6:
minimist@^1.2.0, minimist@^1.2.5, minimist@^1.2.6:
version "1.2.6"
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.6.tgz#8637a5b759ea0d6e98702cfb3a9283323c93af44"
integrity sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==