Skip to content
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

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Add docker and make file #22

wants to merge 6 commits into from

Conversation

KevinSnyderCodes
Copy link
Collaborator

Add dockerfile and makefile

package.json Outdated
@@ -4,7 +4,7 @@
"description": "",
"main": "lib/index.js",
"scripts": {
"build": "tsc",
"build": "tsc --keyofStringsOnly",
Copy link
Collaborator Author

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
Copy link
Collaborator Author

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
Copy link
Collaborator Author

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
Copy link
Collaborator Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants