mirror of
https://github.com/freeCodeCamp/devdocs
synced 2024-11-16 19:48:10 +01:00
Improved dockerfile, and added alpine version
This commit is contained in:
parent
879f704363
commit
50ca8e2645
3 changed files with 39 additions and 10 deletions
7
.dockerignore
Normal file
7
.dockerignore
Normal file
|
@ -0,0 +1,7 @@
|
|||
.git
|
||||
test
|
||||
Dockerfile*
|
||||
.gitignore
|
||||
.dockerignore
|
||||
.travis.yml
|
||||
*.md
|
25
Dockerfile
25
Dockerfile
|
@ -1,17 +1,22 @@
|
|||
|
||||
FROM ruby:2.4.1
|
||||
MAINTAINER Conor Heine <conor.heine@gmail.com>
|
||||
|
||||
RUN apt-get update
|
||||
RUN apt-get -y install git nodejs
|
||||
COPY . /devdocs
|
||||
RUN gem install bundler
|
||||
|
||||
WORKDIR /devdocs
|
||||
|
||||
RUN bundle install --system
|
||||
RUN thor docs:download --all
|
||||
RUN apt-get update && \
|
||||
apt-get -y install git nodejs && \
|
||||
gem install bundler && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
COPY Gemfile Gemfile.lock Rakefile /devdocs/
|
||||
|
||||
RUN bundle install --system && \
|
||||
rm -rf ~/.gem /root/.bundle/cache /usr/local/bundle/cache
|
||||
|
||||
COPY . /devdocs
|
||||
|
||||
RUN thor docs:download --all && \
|
||||
thor assets:compile && \
|
||||
rm -rf /tmp
|
||||
|
||||
EXPOSE 9292
|
||||
CMD rackup -o 0.0.0.0
|
||||
|
||||
|
|
17
Dockerfile-alpine
Normal file
17
Dockerfile-alpine
Normal file
|
@ -0,0 +1,17 @@
|
|||
FROM ruby:2.4.1-alpine
|
||||
|
||||
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/* /tmp ~/.gem /root/.bundle/cache \
|
||||
/usr/local/bundle/cache /usr/lib/node_modules
|
||||
|
||||
EXPOSE 9292
|
||||
CMD rackup -o 0.0.0.0
|
Loading…
Reference in a new issue