-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use
.env
config file according to NODE_ENV
- Loading branch information
1 parent
b3c8a0f
commit d9634ce
Showing
15 changed files
with
56 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,5 @@ | |
yarn.lock | ||
node_modules | ||
.next | ||
.env | ||
*.env | ||
!sample.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
import firebase from "firebase/app"; | ||
import getConfig from "next/config"; | ||
|
||
import {credentials} from "../config"; | ||
const {publicRuntimeConfig} = getConfig(); | ||
const {credentials} = publicRuntimeConfig; | ||
|
||
export default firebase.apps.length > 0 ? firebase.app() : firebase.initializeApp(credentials); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,17 @@ | ||
const withCss = require("@zeit/next-css"); | ||
|
||
module.exports = withCss({}); | ||
const stage = process.env.NODE_ENV || "production"; | ||
|
||
module.exports = withCss({ | ||
publicRuntimeConfig: { | ||
credentials: { | ||
apiKey: "AIzaSyCpU4SIDfsgqZ2bBaoDaQza4I-0fsocfR8", | ||
authDomain: "react-firebase-85039.firebaseapp.com", | ||
databaseURL: "https://react-firebase-85039.firebaseio.com", | ||
projectId: "react-firebase-85039", | ||
storageBucket: "react-firebase-85039.appspot.com", | ||
messagingSenderId: "55358337129" | ||
}, | ||
apiUrl: stage === "production" ? "http://knowl-knowl-ciw3basidwqs-321112760.eu-central-1.elb.amazonaws.com" : "http://localhost:5000" | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,4 +9,7 @@ RUN npm install --production | |
|
||
EXPOSE 5000 | ||
|
||
ARG STAGE="production" | ||
ENV NODE_ENV=$STAGE | ||
|
||
CMD [ "npm", "start" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
version: "2" | ||
services: | ||
server: | ||
build: . | ||
build: | ||
context: . | ||
volumes: | ||
- ./:/server | ||
ports: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters