-
Notifications
You must be signed in to change notification settings - Fork 0
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
Docker Deployment #3
Comments
Here's how I debugged it: I copy-pasted your Dockerfile and ran it. I had the following error: Sending build context to Docker daemon 106.5 MB
Step 1/6 : FROM node:7.10-alpine
---> da85451c2a89
Step 2/6 : COPY . .
---> Using cache
---> 19af11a6b4ef
Step 3/6 : RUN yarn install
---> Running in 2d8cc6f4a910
yarn install v0.23.4
[1/4] Resolving packages...
error Refusing to download the git repo {"protocol":"https:","hostname":"github.com","repository":"https://github.com/pocketjoso/css.git"} over HTTPS without a commit hash - possible certificate error? This suggested that there was something wrong with SSL. Weird. Perhaps a missing certificate somewhere. Google led me to this GitHub issue: yarnpkg/yarn#2117 (comment)
When I ran it I got the following error:
This error made more sense! There was no Git installed in that
The build failed with the same error you posted. Finally. Looking at it the first thing that came to my mind was Phantomjs. Critical uses phantomjs to render the page and decide which CSS has to be inlined. Since the error was very cryptic and I knew that phantomjs could have been the issue, I decided to switch my base image to vanilla
Please note that I didn't have to install
Googling led me to this ticket: Medium/phantomjs#392 (comment) and reminded me that I pretend to be clever, but in reality I fail on the basics. Let me explain: When we do We should ask docker to ignore the
Running
Which had to do with critical, I thought. After some research, I figured out that the file is included here: https://github.com/pocketjoso/penthouse/blob/master/lib/phantomjs/non-matching-media-query-remover.js#L3 , so my guess was that there was some error on the path? (Phantomjs can use the same modules as node.js). First attempt was to add the module manually:
It didn't work. So maybe it had to do with the current directory? The easiest way to check was to have an
Which returned:
This suggested that we were working on the root of the filesystem (I must have mentioned to you that the default folder is
Result:
🎉 🎉 |
wow . . . thank you! nice detective work 🕵️ I will use this tomorrow to build a container and (hopefully🤞) deploy |
Yesterday I tried to get the site running in a docker container. I wasn't able to build a container.
This is the content of the Dockerfile
and this is the error I got...
I tried a couple of different approaches, including following this guide on deploying your node project with Docker which produced a different error -
I tried to google all of these errors and read the various github issues people had created, and a few stackoverflow articles and tried to implement the fixes they suggest but nothing worked.
I then took another look at the files in my directory and saw that git was logging some changes to yarn.lock (presumably automatically generated when I ran yarn install locally). These changes are on line 514 and line 515 and remove the '+git' from the https urls. I added these back in and tried to rebuild the container and got the error:
I'm not really sure where to go next but thought I would document my problems here so you know what I've been up to.
The text was updated successfully, but these errors were encountered: