sitespeedio / coach

Clear Eyes. Full Hearts. Can’t Lose.
MIT License
1.21k stars 64 forks source link

Dockerfile Issue #281

Closed dabula-s closed 6 years ago

dabula-s commented 6 years ago

I built a Docker container, but it doesn't work correctly. Command line:

docker run --rm serg/coach:1.0 --details http://example.com

Output:

 Google Chrome 62.0.3202.75 
 Mozilla Firefox 54.0.1
 Unhandled rejection Error: ENOENT: no such file or directory, open '/usr/src/app/dist/coach.min.js'
 Unhandled rejection Error: ENOENT: no such file or directory, open '/usr/src/app/dist/coach.min.js'
 [2017-11-28 13:23:05] Testing url http://example.com run 1
 Error running advice:  Error: ENOENT: no such file or directory, open '/usr/src/app/dist/coach.min.js
soulgalore commented 6 years ago

Hey @SeriyVol4ishe I tried the official one and it works for me: docker run --shm-size=512m sitespeedio/coach:1.0.0 https://www.sitespeed.io

Do you use our Dockerfile or did you create your own? Best Peter

dabula-s commented 6 years ago

Hm, your variant works. I clone this rep from github and then build docker container with your Dockerfile from the same directory: docker build -t serg/coach ~/coach

beenanner commented 6 years ago

@SeriyVol4ishe you may need to run the prepublish command to generate the min js before the docker build?

npm run prepublish

@soulgalore looks like we have the dist in the .gitignore file should we actually remove that and track the dist files? https://github.com/sitespeedio/coach/blob/master/.gitignore#L5

soulgalore commented 6 years ago

@beenanner I think we discussed it before and other libs that have the dist checked it's kind of hard to work with (like you do a change and you always need to commit it and you get strange diffs and hard to read merges). But maybe we could add another npm task to make it cleaner so you understand what to run to build it?

beenanner commented 6 years ago

@soulgalore ok sounds like we should update the README.md with some more info on how to build from source.

beenanner commented 6 years ago

@soulgalore do you think setting it as a postinstall task would be overkill? Then the dist js file would be auto generate on npm install. All that would be needed then would be the docker build command or npm install after the git clone.

See: https://github.com/sitespeedio/coach/pull/282

beenanner commented 6 years ago

Never mind that solution would require build tools to be available better to just leave it to the developer to install the build tools and run a few steps. :-)