-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix: PublicRuntimeEnvironment not available in docker #661
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FROM node:12-alpine | ||
FROM node:lts-alpine | ||
|
||
RUN apk add --update bash | ||
|
||
|
@@ -12,6 +12,9 @@ RUN npm install | |
# Copying source files | ||
COPY . . | ||
|
||
# Remove Env variables from container before building | ||
RUN rm -rf .env | ||
|
||
Comment on lines
+15
to
+17
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Removing .env from the docker image during build process. This is to prevent local .env during development from being used for publicRuntimeConfig |
||
# Give permission to run script | ||
RUN chmod +x ./wait-for-it.sh | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import env from "./env"; | ||
import env, { publicRuntimeConfig } from "./env"; | ||
|
||
import asyncHandler from "express-async-handler"; | ||
import cookieParser from "cookie-parser"; | ||
|
@@ -18,7 +18,11 @@ import "./cron"; | |
import "./passport"; | ||
|
||
const port = env.PORT; | ||
const app = nextApp({ dir: "./client", dev: env.isDev }); | ||
const app = nextApp({ | ||
dir: "./client", | ||
dev: env.isDev, | ||
conf: { publicRuntimeConfig } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add |
||
}); | ||
const handle = app.getRequestHandler(); | ||
|
||
app.prepare().then(async () => { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated node