forked from quran/one.quran.com
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
48 lines (37 loc) · 1.11 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
FROM phusion/passenger-customizable:0.9.17
# set correct environment variables
ENV HOME /root
# use baseimage-docker's init process
CMD ["/sbin/my_init"]
# customizing passenger-customizable image
RUN /pd_build/ruby2.2.sh
RUN /pd_build/redis.sh
# native passenger
RUN ruby2.2 -S passenger-config build-native-support
RUN setuser app ruby2.2 -S passenger-config build-native-support
# nginx
RUN rm /etc/service/nginx/down
RUN rm /etc/nginx/sites-enabled/default
ADD docker/one.quran.com /etc/nginx/sites-enabled/one.quran.com
ADD docker/env.conf /etc/nginx/main.d/env.conf
ADD docker/gzip.conf /etc/nginx/conf.d/gzip.conf
# logrotate
COPY docker/nginx.logrotate.conf /etc/logrotate.d/nginx
RUN cp /etc/cron.daily/logrotate /etc/cron.hourly
# setup gems
WORKDIR /tmp
ADD Gemfile Gemfile
ADD Gemfile.lock Gemfile.lock
RUN bundle install
# setup the app
RUN mkdir /home/app/quran
ADD . /home/app/quran/
WORKDIR /home/app/quran
RUN chown -R app log
RUN chown -R app public
RUN chown app Gemfile
RUN chown app Gemfile.lock
# cleanup apt
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# expose port 3000
EXPOSE 3000