Open simonwep opened 4 years ago
in next.config.js the package dotenv
is used to merge a .env file into process.env
environment variables:
const { parsed: localEnv } = require("dotenv").config();
module.exports = {
publicRuntimeConfig: {
CONTACT_EMAIL: localEnv && localEnv.CONTACT_EMAIL,
SITE_NAME: localEnv && localEnv.SITE_NAME,
DEFAULT_DOMAIN: localEnv && localEnv.DEFAULT_DOMAIN,
RECAPTCHA_SITE_KEY: localEnv && localEnv.RECAPTCHA_SITE_KEY,
GOOGLE_ANALYTICS: localEnv && localEnv.GOOGLE_ANALYTICS,
REPORT_EMAIL: localEnv && localEnv.REPORT_EMAIL,
DISALLOW_ANONYMOUS_LINKS: localEnv && localEnv.DISALLOW_ANONYMOUS_LINKS,
DISALLOW_REGISTRATION: localEnv && localEnv.DISALLOW_REGISTRATION,
SENTRY_PUBLIC_DSN: localEnv && localEnv.SENTRY_PUBLIC_DSN,
}
};
parsed
contains the parsed contents of such a .env file but this is not the merged output of "native" process.env + .env file and from my understanding nothing speaks against using the merged output, e.g. process.env
.
doesn't work for me either. try using dotenv-flow
$ curl localhost:8017
curl: (56) Recv failure: Connection reset by peer
Found a simple way to solve .env changes reflect on frontend.
From ".dockerignore" just remove ".env" after that just rebuild it.
Is there a way to set these variables without using volumes or rebuilding the image?
Solution that allegedly works by using volumes, not sure about a solution without volumes yet: https://github.com/thedevs-network/kutt/issues/365#issuecomment-743462223
Options such as
DISALLOW_REGISTRATION
andDISALLOW_ANONYMOUS_LINKS
are used on the client page and since the docker images come with prebuild frontend you'll only get an error message if you try to shorten a link whenDISALLOW_ANONYMOUS_LINKS
is set tofalse
so instead of hiding a page altogether and redirecting the user to/login
you'll get an error message:Is this a known issue or am I doing something wrong? I copied the
docker-compose.yml
file and copied the content of.docker.env
in the.env
file, made my changes (including setting both previously mentioned keys tofalse
) and started the app usingdocker-compose up
.My env: