Skip to content

armgit / umami

Public Imported from GitHub
0

Umami is a privacy-first web and product analytics platform. Traffic, campaigns, behavior, conversions, and revenue in one place. No cookies, no surveillance, self-hosted or in the cloud.

Update docker build.

Mike Cao6541ba1ab4d7
diff --git a/Dockerfile b/Dockerfile
index 31dfe7a36..e6cc888c1 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -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
diff --git a/package.json b/package.json
index 122edfe90..74e481eca 100644
--- a/package.json
+++ b/package.json
@@ -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",
diff --git a/scripts/check-db.js b/scripts/check-db.js
index b9582dbd7..702581980 100644
--- a/scripts/check-db.js
+++ b/scripts/check-db.js
@@ -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}`));
diff --git a/scripts/start-env.js b/scripts/start-env.js
index 63b663694..bfaf1330f 100644
--- a/scripts/start-env.js
+++ b/scripts/start-env.js
@@ -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']);
diff --git a/yarn.lock b/yarn.lock
index 65b1e2d33..fd0a907c4 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -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 @@ [email protected], 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==