|
1 | | -FROM ruby:slim |
| 1 | +FROM bitnami/minideb:latest |
2 | 2 |
|
3 | | -# uncomment these if you are having this issue with the build: |
4 | | -# /usr/local/bundle/gems/jekyll-4.3.4/lib/jekyll/site.rb:509:in `initialize': Permission denied @ rb_sysopen - /srv/jekyll/.jekyll-cache/.gitignore (Errno::EACCES) |
5 | | -# ARG GROUPID=901 |
6 | | -# ARG GROUPNAME=ruby |
7 | | -# ARG USERID=901 |
8 | | -# ARG USERNAME=jekyll |
| 3 | +Label MAINTAINER Amir Pourmand |
9 | 4 |
|
10 | | -ENV DEBIAN_FRONTEND noninteractive |
| 5 | +RUN apt-get update -y |
11 | 6 |
|
12 | | -LABEL authors="Amir Pourmand,George Araújo" \ |
13 | | - description="Docker image for al-folio academic template" \ |
14 | | - maintainer="Amir Pourmand" |
15 | | - |
16 | | -# uncomment these if you are having this issue with the build: |
17 | | -# /usr/local/bundle/gems/jekyll-4.3.4/lib/jekyll/site.rb:509:in `initialize': Permission denied @ rb_sysopen - /srv/jekyll/.jekyll-cache/.gitignore (Errno::EACCES) |
18 | | -# add a non-root user to the image with a specific group and user id to avoid permission issues |
19 | | -# RUN groupadd -r $GROUPNAME -g $GROUPID && \ |
20 | | -# useradd -u $USERID -m -g $GROUPNAME $USERNAME |
21 | | - |
22 | | -# install system dependencies |
23 | | -RUN apt-get update -y && \ |
24 | | - apt-get install -y --no-install-recommends \ |
25 | | - build-essential \ |
26 | | - curl \ |
27 | | - git \ |
28 | | - imagemagick \ |
29 | | - inotify-tools \ |
30 | | - locales \ |
31 | | - nodejs \ |
32 | | - procps \ |
33 | | - python3-pip \ |
34 | | - zlib1g-dev && \ |
35 | | - pip --no-cache-dir install --upgrade --break-system-packages nbconvert |
36 | | - |
37 | | -# clean up |
38 | | -RUN apt-get clean && \ |
39 | | - apt-get autoremove && \ |
40 | | - rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/* /tmp/* |
41 | | - |
42 | | -# set the locale |
| 7 | +# add locale |
| 8 | +RUN apt-get -y install locales |
| 9 | +# Set the locale |
43 | 10 | RUN sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && \ |
44 | 11 | locale-gen |
| 12 | +ENV LANG en_US.UTF-8 |
| 13 | +ENV LANGUAGE en_US:en |
| 14 | +ENV LC_ALL en_US.UTF-8 |
| 15 | + |
| 16 | +# add ruby and jekyll |
| 17 | +RUN apt-get install --no-install-recommends ruby-full build-essential zlib1g-dev -y |
| 18 | +RUN apt-get install imagemagick -y |
45 | 19 |
|
46 | | -# set environment variables |
47 | | -ENV EXECJS_RUNTIME=Node \ |
48 | | - JEKYLL_ENV=production \ |
49 | | - LANG=en_US.UTF-8 \ |
50 | | - LANGUAGE=en_US:en \ |
51 | | - LC_ALL=en_US.UTF-8 |
| 20 | +# install python3 and jupyter |
| 21 | +RUN apt-get install python3-pip -y |
| 22 | +RUN python3 -m pip install jupyter --break-system-packages |
| 23 | + |
| 24 | +# install jekyll and dependencies |
| 25 | +RUN gem install jekyll bundler |
52 | 26 |
|
53 | | -# create a directory for the jekyll site |
54 | 27 | RUN mkdir /srv/jekyll |
55 | 28 |
|
56 | | -# copy the Gemfile and Gemfile.lock to the image |
57 | | -ADD Gemfile.lock /srv/jekyll |
58 | 29 | ADD Gemfile /srv/jekyll |
59 | 30 |
|
60 | | -# set the working directory |
61 | 31 | WORKDIR /srv/jekyll |
62 | 32 |
|
63 | | -# install jekyll and dependencies |
64 | | -RUN gem install --no-document jekyll bundler |
65 | | -RUN bundle install --no-cache |
| 33 | +RUN bundle install |
66 | 34 |
|
67 | | -EXPOSE 8080 |
| 35 | +# Set Jekyll environment |
| 36 | +ENV JEKYLL_ENV=production |
68 | 37 |
|
69 | | -COPY bin/entry_point.sh /tmp/entry_point.sh |
70 | | - |
71 | | -# uncomment this if you are having this issue with the build: |
72 | | -# /usr/local/bundle/gems/jekyll-4.3.4/lib/jekyll/site.rb:509:in `initialize': Permission denied @ rb_sysopen - /srv/jekyll/.jekyll-cache/.gitignore (Errno::EACCES) |
73 | | -# set the ownership of the jekyll site directory to the non-root user |
74 | | -# USER $USERNAME |
| 38 | +EXPOSE 8080 |
75 | 39 |
|
76 | | -CMD ["/tmp/entry_point.sh"] |
| 40 | +CMD ["/bin/bash", "-c", "rm -f Gemfile.lock && exec jekyll serve --watch --port=8080 --host=0.0.0.0 --livereload --verbose --trace"] |
0 commit comments