-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile
More file actions
31 lines (22 loc) · 826 Bytes
/
Dockerfile
File metadata and controls
31 lines (22 loc) · 826 Bytes
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
# code.meedan.com
# a technology blog built using the jeckyll cms
FROM meedan/ruby
# https://github.com/meedan/docker-hub/tree/master/meedan/ruby
MAINTAINER sysops@meedan.com
ENV IMAGE meedan/code-blog
ENV DEPLOYUSER codeblog
ENV DEPLOYDIR /app
RUN adduser $DEPLOYUSER --shell /bin/nologin
COPY ./Gemfile $DEPLOYDIR/Gemfile
COPY ./Gemfile.lock $DEPLOYDIR/Gemfile.lock
RUN chown -R $DEPLOYUSER:$DEPLOYUSER $DEPLOYDIR
WORKDIR $DEPLOYDIR
# its not great form to install as root but unfortunately jekyll does not jive with the `bundle install --deployment` method
RUN echo "gem: --no-rdoc --no-ri" > ~/.gemrc \
&& bundle install --without test development
COPY ./ $DEPLOYDIR
RUN chown -R $DEPLOYUSER:$DEPLOYUSER $DEPLOYDIR
USER $DEPLOYUSER
RUN jekyll build
EXPOSE 4000
ENTRYPOINT ["jekyll","serve","--host=0.0.0.0"]