Coder Social home page Coder Social logo

Comments (6)

coltenkrauter avatar coltenkrauter commented on August 15, 2024

I will note that I am not using jekyll serve in order to serve the site - I am using nginx in a docker container. So you may need a few more dependencies than I listed, but I noticed several other unnecessary themes were being installed. It is probably best to list the dependencies explicitly. 😃

from type-theme.

rohanchandra avatar rohanchandra commented on August 15, 2024

Thanks for bringing this up.

For development purposes, I'd prefer to keep my environment in sync with GitHub Pages, since this is where this theme is mostly used.

Context: I started looking into reducing the dependencies that are installed because I was tired of waiting for lengthy builds to complete.

Have you considered creating your own Docker image, which you can upload or build using a service like Docker Hub, with the dependencies pre-installed?

from type-theme.

coltenkrauter avatar coltenkrauter commented on August 15, 2024

Certainly - I appreciate your speedy response.
I completely understand where you are coming from.

Have you considered creating your own Docker image, which you can upload or build using a service like Docker Hub, with the dependencies pre-installed?

A similar solution has crossed my mind. I plan on investigating a solution like that at some point, but my initial research makes me think it will be somewhat complex.

I sort of wish that the Jekyll build step (or bundle install) could be broken into two steps, 1 for installing dependencies and one for rendering the Jekyll site (templates and stuff) because then I could take advantage of docker caching. I do think this is possible, but again, my limited knowledge of Jekyll makes it seem complex.

from type-theme.

rohanchandra avatar rohanchandra commented on August 15, 2024

A similar solution has crossed my mind. I plan on investigating a solution like that at some point, but my initial research makes me think it will be somewhat complex.

Have a look at using a Dockerfile, it's likely only a couple lines of configuration to set-up (examples).

If you're using Docker Hub, you can also set it to automatically build and upload the image for you whenever you push to the repo with the Dockerfile.

I sort of wish that the Jekyll build step (or bundle install) could be broken into two steps, 1 for installing dependencies and one for rendering the Jekyll site (templates and stuff) because then I could take advantage of docker caching. I do think this is possible, but again, my limited knowledge of Jekyll makes it seem complex.

Does bundle install then jekyll build not work?

from type-theme.

coltenkrauter avatar coltenkrauter commented on August 15, 2024

I appreciate the suggestion with Dockerhub - I actually have a private registry set up so I may do something like that...

Does bundle install then jekyll build not work?

I hadn't tried that.... it totally works! Thank you for the suggestion!
My builds were 50+ seconds. Now they are less than 30 seconds thanks to docker caching (of course the very first build takes a little longer) - I am very happy with that. 🎉

This is my current Dockerfile,

# Stage 1
FROM jekyll/jekyll as jekyll

WORKDIR /app

COPY Gemfile .

RUN chown -R jekyll:jekyll /app

RUN bundle install

COPY . .

RUN chown -R jekyll:jekyll /app

RUN jekyll build --trace

# Stage 2
FROM nginx

COPY --from=jekyll /app/_site /usr/share/nginx/html
COPY ./nginx.conf /etc/nginx/conf.d/default.conf

EXPOSE 80

from type-theme.

rohanchandra avatar rohanchandra commented on August 15, 2024

Great! Glad to hear that worked.

from type-theme.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.