-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
52 lines (43 loc) · 1.25 KB
/
Dockerfile
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# Parent container
FROM alpine:3.13
# Set paths and GitHub Pages gem version to use
ENV SRCPATH="/home/jekyll/src" \
SRVPATH="/srv" \
GITHUB_PAGES_VERSION="227"
# Install build dependencies
RUN apk --no-cache add --virtual build-dependencies \
build-base \
libxml2-dev \
ruby-dev \
# Install runtime requirements
&& apk --no-cache add \
ruby \
ruby-full \
ruby-json \
# Install GitHub Pages gem
&& gem install github-pages --version ${GITHUB_PAGES_VERSION} --no-document \
# Create a group and user to tun
&& addgroup -S jekyll \
&& adduser -S -G jekyll jekyll \
# Create directories
&& mkdir -p ${SRCPATH} ${SRVPATH} \
# Set directory owners
&& chown jekyll:jekyll ${SRCPATH} ${SRVPATH} \
# Remove build dependencies
&& apk --no-cache del \
build-dependencies
# Set runtime user and group
USER jekyll:jekyll
# Copy the default page to the source directory
ADD index.html ${SRCPATH}
# Set the working directory
WORKDIR ${SRCPATH}
# Expose directories as available volumes
VOLUME ${SRCPATH} ${SRVPATH}
# Expose web server
EXPOSE 4000
# Add the entrypoint shell script
ADD entrypoint.sh /entrypoint.sh
# Set the entry point and command
ENTRYPOINT ["/entrypoint.sh"]
CMD ["jekyll"]