-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile.example
43 lines (32 loc) · 1.12 KB
/
Dockerfile.example
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
FROM jaicob/rails-nginx-unicorn
MAINTAINER jaicob([email protected])
WORKDIR /home/rails/my-app
# Install tools needed
RUN sudo npm install -g bower && \
sudo apt-get update && \
yes | sudo apt-get install xvfb && \
yes | sudo apt-get install dbus --fix-missing && \
gem install bundler
# Do this to cache our bundle install
COPY Gemfile* /tmp/cache/
WORKDIR /tmp/cache
RUN bundle install
WORKDIR /home/rails/my-app
# Place custom unicorn configs/scripts here
COPY config/unicorn.rb /etc/my-app/config/unicorn.rb
COPY unicorn_init.sh /etc/init.d/unicorn
# Place custom nginx configs here
COPY config/nginx-app-site.conf /etc/nginx/sites-enabled/default
COPY config/nginx.conf /etc/nginx/nginx.conf
# Configure supervisor
COPY config/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
# Add and Run setup script. This sets up the tmp folder and symlinks it to shared
# as well as sets up the database if necessary
COPY setup.sh /etc/my-app/setup.sh
RUN /etc/my-app/setup.sh
# Expose port 80
EXPOSE 80
EXPOSE 443
# Set environment
ENV RAILS_ENV production
CMD ["/usr/bin/supervisord","-c","/etc/supervisor/conf.d/supervisord.conf"]