-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathDockerfile
44 lines (38 loc) · 1.45 KB
/
Dockerfile
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
32
33
34
35
36
37
38
39
40
41
42
43
44
FROM ubuntu:14.04
ENV APP_PATH /opt/app
RUN apt-get update -qq \
&& apt-get install -y --no-install-recommends software-properties-common \
&& add-apt-repository ppa:kirillshkrogalev/ffmpeg-next \
&& apt-add-repository ppa:brightbox/ruby-ng \
&& add-apt-repository ppa:chris-lea/node.js \
&& apt-get update \
&& apt-get upgrade -y --no-install-recommends \
&& apt-get install -y --no-install-recommends \
git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev libmysqlclient-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties \
imagemagick \
ffmpeg \
ghostscript \
phantomjs \
pngcrush \
libturbojpeg \
ruby2.3 ruby2.3-dev \
nodejs \
&& apt-get autoremove -y \
&& apt-get clean all \
&& rm -rf /var/lib/apt/lists/* \
&& mkdir -p $APP_PATH
# Different layer for gems installation
WORKDIR $APP_PATH
COPY Gemfile $APP_PATH/
RUN echo "gem: --no-ri --no-rdoc" > ~/.gemrc \
&& gem2.3 install bundler \
&& bundle install --jobs `expr $(cat /proc/cpuinfo | grep -c "cpu cores") - 1` --retry 3
# # install nodejs dependencies ( in separate dir due to docker cache)
# ADD package.json /opt/app
# RUN cd /opt/app && npm install
WORKDIR $APP_PATH/src
ADD . $APP_PATH/src
VOLUME $APP_PATH/src
# this is for virtual host purposes
EXPOSE 3000 3001 8080 5000
CMD ["rails", "server", "-b", "0.0.0.0"]