This repository has been archived by the owner on Jul 3, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
60 lines (47 loc) · 1.7 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
60
FROM ministryofjustice/ruby:2.3.3-webapp-onbuild
EXPOSE 3000
ENV UNICORN_PORT 3000
ENV \
STRIKE2_VERSION="0.6.2" \
LEIN_ROOT=true \
UNICORN_PORT="3000" \
WEBUSER="moj" \
ZENDESK_USERNAME="" \
ZENDESK_TOKEN="" \
NEW_RELIC_LICENSE_KEY="" \
APPSIGNAL_PUSH_API_KEY="" \
ANONYMOUS_PLACEHOLDER_EMAIL="" \
RAILS_RELATIVE_URL_ROOT='' \
PDFTK="/usr/bin/pdftk" \
REDIS_STORE="redis://localhost:6379/1" \
# RAILS_ENV="development" \
ENV_NAME="" \
GA_ID="" \
DOCKER_ENV=""
# runit needs inittab
RUN touch /etc/inittab
RUN apt-get update && apt-get install -y \
pdftk \
openjdk-7-jdk
# Download and Compile 'strike2'
RUN mkdir -p /usr/local/bin \
&& wget -O /usr/local/bin/lein \
https://raw.githubusercontent.com/technomancy/leiningen/2.4.2/bin/lein \
&& chmod +x /usr/local/bin/lein
RUN mkdir -p /srv/strike2 /etc/service/strike2 /etc/service/accelerated_claims
RUN git -C /srv clone -b v${STRIKE2_VERSION} https://github.com/ministryofjustice/strike2.git
RUN cd /srv/strike2 && pwd && ls -l && /usr/local/bin/lein deps && /usr/local/bin/lein ring uberjar
COPY ./docker/runit/strike2-service /etc/service/strike2/run
RUN chmod 777 ./log
RUN cd ./log
RUN chmod 777 ./*
COPY ./docker/runit/runit-service /etc/service/accelerated_claims/run
#SECRET_TOKEN set here because otherwise devise blows up during the precompile.
RUN bundle exec rake assets:precompile RAILS_ENV=production SECRET_TOKEN=blah
RUN chmod +x /etc/service/strike2/run /etc/service/accelerated_claims/run
RUN apt-get install -y vim
RUN cd /usr/src/app/log
RUN chmod 777 *
EXPOSE $UNICORN_PORT
CMD ["bundle", "exec", "unicorn", "-p", "3000"]
CMD ["/usr/bin/runsvdir", "-P", "/etc/service"]