My version of jekyll docker image
My Docker Jekyll Image
This is my own Dockerfile to create working Jekyll site. Services inside image are lighttpd and jekyll. This is base of Debian.
Volumes:
- Jekyll site: /srv/jekyll
- Lighttpd configurations: /etc/lighttpd
Ports:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
#Download base image Debian latest
FROM debian:latest
MAINTAINER Joonas Tikkanen <[email protected]>
#Update & Install ruby and lighttpd
RUN apt-get update && \
apt-get install -y nano ruby ruby-dev make gcc git gem sudo bundler lighttpd && \
groupadd -g 1000 jekyll && \
useradd -m -d /home/jekyll -s /bin/bash -c "Jekyll User" -u 1000 -g 1000 jekyll && \
cd ~ && \
mkdir -p /srv/jekyll && \
chown jekyll:jekyll /srv/jekyll && \
echo 'jekyll ALL=NOPASSWD:ALL' >> /etc/sudoers
#VOLUME
VOLUME /srv/jekyll
VOLUME /etc/lighttpd
#USER
USER 1000
# EXPOSE PORTS
EXPOSE 4000 80
#WORKDIR
WORKDIR /srv/jekyll
# CMD
#Jekyll builder
CMD ["bundle", "exec", "jekyll", "build"]
#Lighttpd
CMD ["sudo", "lighttpd", "-D", "-f", "/etc/lighttpd/lighttpd.conf"]
|
To run image use:
1
|
docker run -p 4000:4000 --name tikiblog --volume /home/user/jekyll:/srv/jekyll --volume /etc/lighttpd:/etc/lighttpd --restart always -d tikiblog:latest
|
To build image:
1
|
sudo docker build -t tikiblog .
|