-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
38 lines (29 loc) · 1.12 KB
/
Dockerfile
File metadata and controls
38 lines (29 loc) · 1.12 KB
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
FROM ubuntu:12.04
RUN apt-get update -q
RUN apt-get install -qy nginx
RUN apt-get install -qy curl
RUN apt-get install -qy nodejs
RUN curl -sSL https://rvm.io/mpapis.asc | gpg --import -
RUN curl -sSL https://get.rvm.io | bash -s stable
# -c run the command passed to the -c argument
# -l makes it a login shell so bash first reads /etc/profile
RUN /bin/bash -c "source /etc/profile.d/rvm.sh"
RUN /bin/bash -l -c "rvm requirements"
RUN /bin/bash -l -c "rvm install 2.1.2"
RUN /bin/bash -l -c "gem install bundler --no-ri --no-rdoc"
RUN mkdir /opt/web_app
WORKDIR /opt/web_app
RUN mkdir /opt/web_app/shared
RUN mkdir /opt/web_app/shared/log
RUN mkdir /opt/web_app/shared/pids
ADD rails_app/Gemfile /opt/web_app/Gemfile
ADD rails_app/Gemfile.lock /opt/web_app/Gemfile.lock
RUN /bin/bash -l -c "bundle install"
ADD rails_app /opt/web_app
ADD config/server/nginx.conf /etc/nginx/sites-enabled/default
ADD config/server/start-server.sh /usr/bin/start-server
ADD config/server/unicorn.rb /opt/web_app/config/unicorn.rb
RUN chmod +x /usr/bin/start-server
RUN echo "daemon off;" >> /etc/nginx/nginx.conf
EXPOSE 80
ENTRYPOINT /usr/bin/start-server