Skip to content

Commit

Permalink
Fix path to .env file from Docker and Webpack
Browse files Browse the repository at this point in the history
This path allows for both locally running instances
and the full production build to succeed.

Fix typo reported by gometalinter
  • Loading branch information
brian-nguyen committed Jul 17, 2018
1 parent baa7d9a commit aa870f3
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 10 deletions.
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
# Build and minify React client
FROM node:carbon AS client
WORKDIR /
## ENV DEPENDENCY
ADD .env .
WORKDIR /client
ADD client/package.json .
RUN npm install
ADD client .
## ENV DEPENDENCY
ADD .env .
RUN npm run build

# Build server
Expand Down
30 changes: 25 additions & 5 deletions client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions client/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,10 @@ const config = {
},
plugins: [
new Dotenv({
systemvars: true,
path: '../.env',
systemvars: true
}),
]
],
};

module.exports = config;
2 changes: 1 addition & 1 deletion server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func main() {
if err := godotenv.Load(); err != nil {
log.Println("Cannot load environment variables")
} else {
log.Println("Sucess")
log.Println("Success")
}
}

Expand Down

0 comments on commit aa870f3

Please sign in to comment.