From dcdcea55e671614d2a60c27f95fcff86bad6467b Mon Sep 17 00:00:00 2001 From: Alex Brazier Date: Mon, 8 May 2017 23:23:02 +0100 Subject: [PATCH] Improved dockerfile, and added alpine version --- .dockerignore | 7 +++++++ Dockerfile | 20 ++++++++++++-------- Dockerfile-alpine | 17 +++++++++++++++++ 3 files changed, 36 insertions(+), 8 deletions(-) create mode 100644 .dockerignore create mode 100644 Dockerfile-alpine diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 00000000..64b8f28c --- /dev/null +++ b/.dockerignore @@ -0,0 +1,7 @@ +.git +test +Dockerfile* +.gitignore +.dockerignore +.travis.yml +*.md diff --git a/Dockerfile b/Dockerfile index 13b0918e..0f0f13a0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,17 +1,21 @@ - FROM ruby:2.4.1 MAINTAINER Conor Heine -RUN apt-get update -RUN apt-get -y install git nodejs -COPY . /devdocs -RUN gem install bundler - WORKDIR /devdocs +RUN apt-get update && \ + apt-get -y install git nodejs && \ + gem install bundler + +COPY Gemfile Gemfile.lock Rakefile /devdocs/ + RUN bundle install --system -RUN thor docs:download --all + +COPY . /devdocs + +RUN thor docs:download --all && \ + thor assets:compile && \ + rm -rf /tmp EXPOSE 9292 CMD rackup -o 0.0.0.0 - diff --git a/Dockerfile-alpine b/Dockerfile-alpine new file mode 100644 index 00000000..35526846 --- /dev/null +++ b/Dockerfile-alpine @@ -0,0 +1,17 @@ +FROM ruby:2.4.1-alpine +MAINTAINER Conor Heine + +WORKDIR /devdocs + +COPY . /devdocs + +RUN apk --update add nodejs build-base libstdc++ gzip git zlib-dev && \ + gem install bundler && \ + bundle install --system --without test && \ + thor docs:download --all && \ + thor assets:compile && \ + apk del gzip build-base git zlib-dev && \ + rm -rf /var/cache/apk/* && rm -rf /tmp && rm -rf ~/.gem + +EXPOSE 9292 +CMD rackup -o 0.0.0.0