-
Notifications
You must be signed in to change notification settings - Fork 10
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
Add docker and make file #22
base: master
Are you sure you want to change the base?
Conversation
package.json
Outdated
@@ -4,7 +4,7 @@ | |||
"description": "", | |||
"main": "lib/index.js", | |||
"scripts": { | |||
"build": "tsc", | |||
"build": "tsc --keyofStringsOnly", |
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.
Remove --keyofStringsOnly
Dockerfile
Outdated
COPY . . | ||
RUN npm run-script build | ||
|
||
EXPOSE 3000 |
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.
Also EXPOSE 8000
, used by socket.io
Dockerfile
Outdated
|
||
COPY package.json ./ | ||
|
||
RUN npm install |
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.
This isn't getting cached, which causes the build to take a long time. Dockerfile
should be reworked so that this operation is only executed if package.json
changes.
A good article on how to do this: http://bitjudo.com/blog/2014/03/13/building-efficient-dockerfiles-node-dot-js/
Dockerfile
Outdated
|
||
RUN npm install | ||
COPY . . | ||
RUN npm run-script build |
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.
This actually isn't necessary. npm run start
serves an unbuilt version of the React app and Node server (e.g. it watches for changes to the React app and serves those changes as they happen).
I haven't figured out a clean way to serve a build version of the React app and Node server. If we find that npm run start
is just too slow on the Pi, we can work that out and it should run faster.
Add dockerfile and makefile