Skip to content

Commit 50ca8e2

Browse files
alexbrazierThibaut
authored andcommitted
Improved dockerfile, and added alpine version
1 parent 879f704 commit 50ca8e2

File tree

3 files changed

+39
-10
lines changed

3 files changed

+39
-10
lines changed

.dockerignore

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.git
2+
test
3+
Dockerfile*
4+
.gitignore
5+
.dockerignore
6+
.travis.yml
7+
*.md

Dockerfile

+15-10
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,22 @@
1-
21
FROM ruby:2.4.1
3-
MAINTAINER Conor Heine <[email protected]>
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
Original file line numberDiff line numberDiff line change
@@ -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

0 commit comments

Comments
 (0)