Docker Compose for Jekyll
Docker Compose for Jekyll: development and production
Docker is very useful to setup the development environment without taking much effort. In this tutorial, you can see how we apply Docker Compose to quickly configure the development environment for Jekyll.
Docker Compose for Jekyll development:
- Create
docker-compose.yml
version: '2' services: jekyll_web: command: jekyll serve --force_polling image: jekyll/jekyll:latest volumes: - ./jekyll:/srv/jekyll ports: - 4000:4000 - 35729:35729 - 3000:3000 - 80:4000
- Create
jekyll
directory in the same place withdocker-compose.yml
- The directory structure will look similar to this:
jekyll_web |- jekyll |- docker-compose.yml
- Put your source code into
jekyll
directory and start Docker container:$ cd /path/to/jekyll_web $ docker-compose up
- The Docker container starts successfully, then you can enjoy your site at
localhost
I prepare some docker-compose files. You can download:
- docker-compose-jekyll.zip similar to the above instruction.
- docker-compose-jekyll-sample.zip a sample Jekyll site using Minimal Theme.
Docker Compose for Jekyll PRODUCTION:
- We simply add
environment
to the Docker compose file. We can build the production site by using the followingdocker-compose.yml
:version: '2' services: jekyll_web: command: jekyll build image: jekyll/jekyll:latest volumes: - ./jekyll:/srv/jekyll ports: - 4000:4000 - 35729:35729 - 3000:3000 - 80:4000 environment: - JEKYLL_ENV:production
- To build it:
$ cd /path/to/jekyll_web $ docker-compose up
Just ask me if you have any issues.
More docker-compose files for you:
- Docker Compose for Traefik (reverse proxy HTTP)
- Set up Nginx reverse proxy HTTP/HTTPS with Docker Compose
- Docker compose for VSCode server
- Set up Pytorch Env with Docker within 1 Minute
- Docker Compose for Jekyll
- Docker Compose for Odoo 10
- Docker Compose for Odoo 11
- Docker Compose for Odoo 12
- Docker Compose for Odoo 13