david/jekyll-dev
david
/
jekyll-dev
Archived
1
0
Fork 0
This repository has been archived on 2023-12-23. You can view files and clone it, but cannot push or open issues or pull requests.
jekyll-dev/Dockerfile

32 lines
876 B
Docker
Raw Permalink Normal View History

2020-10-23 23:00:18 +02:00
# Dockerfile to build and serve a jekyll site with the development webserver
FROM ubuntu:focal
2020-11-01 00:15:13 +01:00
LABEL Description="This image is used for developing Jekyll sites." \
2020-10-23 23:00:18 +02:00
Author="david@socialnerds.org" \
Version="0.1" \
License="MIT"
# environment variables
2020-10-28 19:18:30 +01:00
ENV USER_ID=1000
ENV GROUP_ID=1000
ENV USERNAME=jekyll-dev
2020-10-23 23:00:18 +02:00
# expose port for jekyll development webserver
2020-10-23 23:00:18 +02:00
EXPOSE 4000
# volume definitions
VOLUME ["/mnt"]
# prepare the baseimage
2020-11-01 00:15:13 +01:00
RUN apt-get update && apt-get install -y ruby ruby-dev gcc g++ make libssl-dev libreadline-dev python3 && \
2020-10-28 19:18:30 +01:00
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
2020-10-28 19:18:30 +01:00
2020-11-01 00:15:13 +01:00
# set working directory
WORKDIR /mnt
2020-10-28 19:18:30 +01:00
# set executing user name
USER $USERNAME
2020-10-23 23:00:18 +02:00
# run jekyll script
2020-11-01 00:15:13 +01:00
CMD python3 -m http.server -d _site 4000