aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Dockerfile
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2020-05-04 23:14:00 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2020-05-04 23:14:00 +0300
commit51e4faca24073cee7558aa66e37428dcffcfbc10 (patch)
treebf9796ed8a71193a72a6d415229e39f9ce5822f4 /Dockerfile
downloadjekyll-docker-51e4faca24073cee7558aa66e37428dcffcfbc10.tar.gz
jekyll-docker-51e4faca24073cee7558aa66e37428dcffcfbc10.zip
initial commit
Diffstat (limited to 'Dockerfile')
-rw-r--r--Dockerfile41
1 files changed, 41 insertions, 0 deletions
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 0000000..1f56c22
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,41 @@
+FROM debian:buster-slim
+
+SHELL ["/bin/bash", "-c"]
+
+ENV DEBIAN_FRONTEND=noninteractive
+
+RUN apt update -yq && \
+ apt install -yq --no-install-recommends \
+ build-essential \
+ ca-certificates wget \
+ sudo
+
+# Creating regular user 'developer':
+ARG USER=developer
+RUN addgroup "$USER" && \
+ adduser --disabled-password --gecos "" --ingroup "$USER" --home "/home/$USER" "$USER" && \
+ addgroup "$USER" sudo && \
+ echo -e '%sudo ALL=(ALL) NOPASSWD:ALL\nDefaults env_keep += "HOME"' >> /etc/sudoers
+
+USER "$USER"
+ENV src_dir="/home/$USER/src"
+RUN mkdir -p -- "$src_dir/docker"
+WORKDIR "$src_dir/docker"
+
+ENV PATH="/home/$USER/.local/bin:$PATH"
+
+COPY ["docker/Makefile", "./"]
+RUN sudo make ruby-install && \
+ sudo make ruby-install/clean && \
+ make ruby && \
+ sudo make chruby && \
+ sudo make chruby/profile.d && \
+ sudo make chruby/clean && \
+ make bundler
+
+COPY ["Gemfile", "Gemfile.lock", "../"]
+RUN make dependencies
+
+COPY [".", "../"]
+RUN sudo chown -R "$USER:$USER" ../
+CMD make jekyll/serve