david/jekyll-dev
david
/
jekyll-dev
Archived
1
0
Fork 0

initial commit

This commit is contained in:
david 2020-10-23 23:00:18 +02:00
commit 53857edf18
4 changed files with 52 additions and 0 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
*.swp
*~

26
Dockerfile Normal file
View File

@ -0,0 +1,26 @@
# Dockerfile to build and serve a jekyll site with the development webserver
FROM ubuntu:focal
LABEL Description="This image is used to learn building dockerfiles" \
Author="david@socialnerds.org" \
Version="0.1" \
License="MIT"
# environment variables
ENV JEKYLL_SITE=default
# copy stuff into the image
COPY jekyll.sh jekyll.sh
RUN chmod +x jekyll.sh
# expose port for `jekyll serve`
EXPOSE 4000
# volume definitions
VOLUME ["/mnt"]
# prepare the baseimage
RUN apt-get update && apt-get install -y ruby ruby-dev gcc g++ make libssl-dev libreadline-dev && \
gem update && gem install jekyll bundler
# run command
CMD ./jekyll.sh

13
docker-compose.yml Normal file
View File

@ -0,0 +1,13 @@
version: "3.0"
services:
jekyll:
image: jekyll-dev:latest
build: .
container_name: jekyll-dev
volumes:
- /home/david/Projects/just-the-docs:/mnt
ports:
- 127.0.0.1:4000:4000
environment:
- JEKYLL_SITE=docs

11
jekyll.sh Normal file
View File

@ -0,0 +1,11 @@
#!/bin/bash
# create new or serve existing jekyll page (/mnt/$JEKYLL_SITE)
cd /mnt
if [ ! -d "/mnt/$JEKYLL_SITE" ]; then
jekyll new $JEKYLL_SITE
fi
cd $JEKYLL_SITE
bundle install
bundle exec jekyll serve --host=0.0.0.0 --incremental