-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
42 lines (30 loc) · 1.15 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
FROM ruby:2.2.2
MAINTAINER Mook <mookjpy@gmail.com>
# Install nginx with passenger
RUN gem install passenger -v 5.0.4 && \
apt-get update && \
apt-get install -y libcurl4-openssl-dev && \
passenger-install-nginx-module --auto
ADD docker/rails/conf/nginx.conf /opt/nginx/conf/nginx.conf
# Add configuration to set daemon mode off
RUN echo "daemon off;" >> /opt/nginx/conf/nginx.conf
# Install Rails dependencies
RUN apt-get update && apt-get install -y nodejs --no-install-recommends && rm -rf /var/lib/apt/lists/*
RUN apt-get update && apt-get install -y mysql-client postgresql-client sqlite3 --no-install-recommends && rm -rf /var/lib/apt/lists/*
# throw errors if Gemfile has been modified since Gemfile.lock
RUN bundle config --global frozen 1
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
ADD Gemfile /usr/src/app/
ADD Gemfile.lock /usr/src/app/
RUN bundle install --system
ADD . /usr/src/app
# Initialize log
RUN cat /dev/null > /usr/src/app/log/production.log
RUN chmod -R a+w /usr/src/app/log
EXPOSE 80
ENV RAILS_ENV=production
ADD docker/rails/start.sh /usr/src/app/
RUN chmod +x /usr/src/app/start.sh
WORKDIR /usr/src/app/
CMD ["./start.sh"]