33 lines
904 B
Docker
33 lines
904 B
Docker
# Dockerfile to build and serve a jekyll site with the development webserver
|
|
FROM ubuntu:focal
|
|
LABEL Description="This image is used build and serve jekyll sites" \
|
|
Author="david@socialnerds.org" \
|
|
Version="0.1" \
|
|
License="MIT"
|
|
|
|
# environment variables
|
|
ENV JEKYLL_SITE=default
|
|
ENV USER_ID=1000
|
|
ENV GROUP_ID=1000
|
|
ENV USERNAME=jekyll-dev
|
|
|
|
# expose port for jekyll development webserver
|
|
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 && \
|
|
groupadd -g $GROUP_ID $USERNAME && \
|
|
useradd -u $USER_ID -g $GROUP_ID -m -d /home/$USERNAME -s /bin/false $USERNAME
|
|
|
|
# copy jekyll script into the image
|
|
COPY jekyll.sh /opt/jekyll.sh
|
|
|
|
# set executing user name
|
|
USER $USERNAME
|
|
|
|
# run jekyll script
|
|
CMD bash /opt/jekyll.sh |