-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.tmpl
50 lines (38 loc) · 1.58 KB
/
Dockerfile.tmpl
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
FROM ruby:{{ .RUBY_VERSION }}
MAINTAINER iron.io
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update \
&& apt-get install -qq -y software-properties-common wget vim
# install nginx
RUN apt-key adv --keyserver hkp://pgp.mit.edu:80 --recv-keys 573BFD6B3D8FBC641079A6ABABF5BD827BD9BF62 \
&& echo "deb http://nginx.org/packages/debian/ jessie nginx" >> /etc/apt/sources.list \
&& apt-get update \
&& apt-get install -qq -y nginx=1.10.2-1~jessie
# install foreman
RUN gem install foreman
# install the latest postgresql lib for pg gem
RUN echo "deb http://apt.postgresql.org/pub/repos/apt/ trusty-pgdg main" > /etc/apt/sources.list.d/pgdg.list && \
apt-get update && \
apt-get install -y --force-yes libpq-dev
# install MySQL(for mysql, mysql2 gem)
RUN apt-get install -qq -y libmysqlclient-dev
# install dockerize
RUN wget -q https://github.com/jwilder/dockerize/releases/download/v0.2.0/dockerize-linux-amd64-v0.2.0.tar.gz \
&& tar -C /usr/local/bin -xzvf dockerize-linux-amd64-v0.2.0.tar.gz
RUN apt-get clean \
&& cd /var/lib/apt/lists && rm -fr *Release* *Sources* *Packages* \
&& truncate -s 0 /var/log/*log
# install Rails App
WORKDIR /app
ENV RAILS_ENV production
ONBUILD ADD Gemfile /app/Gemfile
ONBUILD ADD Gemfile.lock /app/Gemfile.lock
ONBUILD RUN bundle install --without development test
ONBUILD ADD . /app
ADD nginx-sites.conf /etc/nginx/sites-enabled/default
ADD nginx.conf /etc/nginx/nginx.conf
ADD unicorn.rb /app/config/unicorn.rb
ADD Procfile /app/Procfile
# ADD server.crt /etc/nginx/ssl/server.crt
# ADD server.key /etc/nginx/ssl/server.key
CMD foreman start -f Procfile