Skip to content

melissakipp/melissajkipp

Repository files navigation

Simple! Jekyll Development Enviorment

Build Status


Resource: [Bret Fisher](https://github.com/BretFisher/jekyll-serve)

Steps:

  1. Create your project folder.

    $ mkdir <project-name>
    $ cd <project-name>

  2. Run Docker command NOTE Be sure to ONLY run this in an empty folder.

    $ docker run --rm -v $(pwd):/site bretfisher/jekyll new .

    _ This install basic necessities to start a Jekyll site. _ NOTE: --rm flag will remove this container once it is done installing the basic Jekyll files.

  3. Check: make sure you are still in the project folder

    $ pwd

  4. Make a docker-compose file

    $ touch docker-compose.yml
    $ vi docker-compose.yml

    _ https://gist.github.com/melissakipp/33347071308a0c6e8daf78e7cf02e1a5 _ NOTE: I add a container_name to may docker-compose.yml file

  5. Once the dev container is complete there is a permission issue1

    $ sudo chmod -R 777 .

  6. Start containter

    $ docker compose up

    * NOTE: Adding -d flag so that it runs detach.

  7. Daily commands (make sure you are in the project folder):

    $ docker compose stop
    $ docker compose start
    $ docker compose restart

    * Restart is mostly used when there are changes to the _config.yml

Project Completed

Once the project is completed $ docker compose down -v --rmi all

  • -v flag will remove volumes.
  • --rmi all flag will remove all images for the project.

Tip:

_config.yml

exclude:
  - .sass-cache/
  - .jekyll-cache/
  - gemfiles/
  - Gemfile
  - Gemfile.lock
  - node_modules/
  - vendor/bundle/
  - vendor/cache/
  - vendor/gems/
  - vendor/ruby/
  - docker-compose

####TODO:

  • Review Ruby
  • Learn about Jekyll development
  • Experiment with testing frameworks
  • Learn CI/CD processes

Footnotes

  1. ISSUE: Permissions are not correct for initial container build - I am not sure how to set permission without a Dockerfile.