History

Improved dockerfile, and added alpine version

Alex Brazier committed 9 years ago

Commit 50ca8e21 parent 879f7043 files · +39 −10Browse files

Unified · Split

3 files
  1. .dockerignore +7 −0
  2. Dockerfile +15 −10
  3. Dockerfile-alpine +17 −0
.dockerignore+7−0
@@ -0,0 +1,7 @@
1+.git
2+test
3+Dockerfile*
4+.gitignore
5+.dockerignore
6+.travis.yml
7+*.md
Dockerfile+15−10
@@ -1,17 +1,22 @@
1−
21 FROM ruby:2.4.1
3−MAINTAINER Conor Heine <conor.heine@gmail.com>
4−
5−RUN apt-get update
6−RUN apt-get -y install git nodejs
7−COPY . /devdocs
8−RUN gem install bundler
92
103 WORKDIR /devdocs
114
12−RUN bundle install --system
13−RUN thor docs:download --all
5+RUN apt-get update && \
6+ apt-get -y install git nodejs && \
7+ gem install bundler && \
8+ rm -rf /var/lib/apt/lists/*
9+
10+COPY Gemfile Gemfile.lock Rakefile /devdocs/
11+
12+RUN bundle install --system && \
13+ rm -rf ~/.gem /root/.bundle/cache /usr/local/bundle/cache
14+
15+COPY . /devdocs
16+
17+RUN thor docs:download --all && \
18+ thor assets:compile && \
19+ rm -rf /tmp
1420
1521 EXPOSE 9292
1622 CMD rackup -o 0.0.0.0
17−
Dockerfile-alpine+17−0
@@ -0,0 +1,17 @@
1+FROM ruby:2.4.1-alpine
2+
3+WORKDIR /devdocs
4+
5+COPY . /devdocs
6+
7+RUN apk --update add nodejs build-base libstdc++ gzip git zlib-dev && \
8+ gem install bundler && \
9+ bundle install --system --without test && \
10+ thor docs:download --all && \
11+ thor assets:compile && \
12+ apk del gzip build-base git zlib-dev && \
13+ rm -rf /var/cache/apk/* /tmp ~/.gem /root/.bundle/cache \
14+ /usr/local/bundle/cache /usr/lib/node_modules
15+
16+EXPOSE 9292
17+CMD rackup -o 0.0.0.0