-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
36 lines (28 loc) · 972 Bytes
/
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
FROM phusion/passenger-customizable
MAINTAINER Boik Su "[email protected]"
ENV HOME /root
ENV RAILS_ENV production
CMD ["/sbin/my_init"]
# Build system and git.
RUN /pd_build/utilities.sh
# Ruby support.
RUN /pd_build/ruby-2.3.1.sh
RUN apt-get update \
&& apt-get install -y sudo lxc
WORKDIR /tmp
COPY Gemfile Gemfile
COPY Gemfile.lock Gemfile.lock
RUN chown -R app.app /tmp \
&& gem install bundler \
&& bundle install --jobs 40 --retry 10
# Enable the Nginx service.
RUN rm -f /etc/service/nginx/down \
&& rm /etc/nginx/sites-enabled/default
COPY wardrobe.conf /etc/nginx/sites-enabled/wardrobe.conf
COPY rails-env.conf /etc/nginx/main.d/rails-env.conf
COPY . /home/app/wardrobe
WORKDIR /home/app/wardrobe
RUN chown -R app:app /home/app/wardrobe \
&& sudo -u app RAILS_ENV=production bundle exec rake assets:precompile \
&& groupadd -g 999 docker && usermod -a -G docker app \
&& apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*