-
Notifications
You must be signed in to change notification settings - Fork 145
Add a Docker-based setup. #600
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
Conversation
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.
A bunch of suggestions for improvements, but for this kind of build, not super critical.
|
||
RUN apt install -y curl | ||
RUN curl -fsSL https://deb.nodesource.com/setup_18.x | bash - | ||
RUN apt install -y nodejs |
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.
We need Node.js as well to build the website?
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.
Yes. We need it for one the plugins, which calls into JS for some reason. I added a comment.
ports: | ||
- '4000:4000' | ||
volumes: | ||
- .:/srv/jekyll |
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.
Instead of doing the usual UID hackery, have you considered:
- read-only mounting the sources
- configure jekyll's build directory away into the docker overlay FS
--destination /tmp/jekyll-site
For fully building the website (to deploy), I suggest docker cp
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.
To be honest, I have no idea what I'm doing. I have 0 Docker knowledge. I copy-pasted from the setup for scala-lang which is at https://github.com/scala/scala-lang/blob/main/docker-compose.yml
This was apparently copied from docs.scala-lang.org to solve some issue, copying changes in scala/docs.scala-lang#2622
🤷♂️
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.
:) that's pretty much how this looked 😹
If this is not super urgent, I can make an alternative suggestion (I use docker daily now).
If yes, I'd appreciate a quick description of your deployment process to make sure I'm not making it worse.
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.
It's not urgent at all. I only use it locally. I can keep it local until there's something good.
The deployment is still working Docker-free in GitHub Actions. It's in https://github.com/scala-js/scala-js-website/blob/main/.github/workflows/deploy.yml
COPY Gemfile.lock . | ||
|
||
RUN echo -n "bundle version: " && bundle --version | ||
RUN chmod u+s /bin/chown |
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.
😨 😨
Dockerfile
Outdated
COPY Gemfile . | ||
COPY Gemfile.lock . | ||
|
||
RUN echo -n "bundle version: " && bundle --version |
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.
Shouldn't this always be 2.3.10?
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.
Yes, indeed. I guess this was a debug print.
docker-compose.yml
Outdated
jekyll: | ||
user: "${UID}:${GID}" | ||
build: . | ||
command: sh -c "chown $UID / && echo NODE && node -v && bundle exec jekyll serve --incremental --host=0.0.0.0 " |
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.
Do we need --watch
here (like the README.md says)?
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.
That would be more consistent, indeed.
I can't run Ruby 2.7.x on my machine anymore. Docker was the only solution I found. It may help others getting started to contribute to this website as well. The setup is basically copied from that of `scala-lang.org`, but with an additional setup of Node.js.
86d7e78
to
ef014a0
Compare
Based off scala-js#600. I can't run Ruby 2.7.x on my machine anymore. Docker was the only solution I found. It may help others getting started to contribute to this website as well. The setup is inspired by that of `scala-lang.org`, but modified to avoid UID hacker (instead has some volume hackery).
Based off scala-js#600. I can't run Ruby 2.7.x on my machine anymore. Docker was the only solution I found. It may help others getting started to contribute to this website as well. The setup is inspired by that of `scala-lang.org`, but modified to avoid UID hackery (instead has some volume hackery).
Alternative: #601. |
Superseded by #601. |
I can't run Ruby 2.7.x on my machine anymore. Docker was the only solution I found. It may help others getting started to contribute to this website as well.
The setup is basically copied from that of
scala-lang.org
, but with an additional setup of Node.js.