-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
59 lines (40 loc) · 1.23 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# Dockerfile for a Rails application using Nginx and Puma
# Select ubuntu as the base image
FROM seapy/ruby:2.3.0
MAINTAINER Edgar Z <[email protected]>
# Update
RUN apt-get update -q
# Postgres
RUN apt-get install -qy --force-yes libpq-dev
# for a JS runtime
RUN apt-get install -qy nodejs
RUN apt-get install -qy curl
# for nokogiri
#RUN apt-get install -qy libxml2-dev libxslt1-dev
# for capybara-webkit
#RUN apt-get install -qy libqt4-webkit libqt4-dev xvfb
# exiftool
#RUN apt-get install -qy libimage-exiftool-perl
# NGINX
RUN apt-get install -qy nginx
RUN echo "daemon off;" >> /etc/nginx/nginx.conf
RUN chown -R www-data:www-data /var/lib/nginx
# Install foreman
RUN gem install bundler
RUN gem install foreman
RUN gem install rails
# Add configuration files in repository to filesystem
ADD config/container/nginx-sites.conf /etc/nginx/sites-enabled/default
#(required) Install Rails App
# Add rails project to project directory
ADD ./ /docker
# set WORKDIR
WORKDIR /docker
# bundle install
RUN bundle install --without development test
ENV RAILS_ENV production
ENV PORT 8080
#(required) nginx port number
EXPOSE 8080
# Startup commands
CMD bundle exec rake db:create db:migrate assets:precompile && foreman start -f Procfile