forked from EFForg/action-center-platform
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
87 lines (72 loc) · 2.37 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
FROM ruby:2.3-slim
RUN mkdir /opt/actioncenter
WORKDIR /opt/actioncenter
RUN apt-get update && \
apt-get install -y --no-install-recommends \
curl \
build-essential \
git \
libpq-dev \
libfontconfig \
postgresql-client \
cron \
gnupg
RUN set -x; \
curl -sL https://deb.nodesource.com/setup_6.x -o nodesource_setup.sh \
&& chmod +x nodesource_setup.sh \
&& ./nodesource_setup.sh \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
nodejs \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \
&& echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list \
&& apt-get update \
&& apt-get install \
yarn
# Create a symlink to what will be the phantomjs exec path
RUN ln -s /phantomjs-2.1.1-linux-x86_64/bin/phantomjs /bin/phantomjs
# Set up phantomjs, making sure to check the known good sha256sum
RUN cd / && curl -sLo phantomjs.tar.bz2 https://github.com/Medium/phantomjs/releases/download/v2.1.1/phantomjs-2.1.1-linux-x86_64.tar.bz2 && \
bash -l -c '[ "`sha256sum phantomjs.tar.bz2 | cut -f1 -d" "`" = "86dd9a4bf4aee45f1a84c9f61cf1947c1d6dce9b9e8d2a907105da7852460d2f" ]' && \
tar -jxvf phantomjs.tar.bz2 > /dev/null && \
rm phantomjs.tar.bz2
COPY yarn.lock package.json ./
RUN yarn install
ADD Gemfile* ./
RUN bundle install
ADD bin/ ./bin
ADD config/ ./config
ADD config.ru ./
ADD Rakefile ./
ADD db/ ./db
ADD lib/ ./lib
ADD public/ ./public
ADD app/ ./app
ADD features/ ./features
ADD script/ ./script
ADD spec/ ./spec
ADD vendor/ ./vendor
ADD docker/ ./docker
ADD .rubocop.yml ./.rubocop.yml
ADD .sass-lint.yml ./.sass-lint.yml
RUN usermod -u 1000 www-data
COPY docker/crontab /etc/cron.d/crontab
RUN chmod 0644 /etc/cron.d/crontab
RUN bundle exec rake assets:precompile \
RAILS_ENV=production \
SECRET_KEY_BASE=noop \
devise_secret_key=noop \
DATABASE_URL=postgres://noop
RUN bundle exec rake webshims:update_public
RUN mkdir /opt/actioncenter/log \
/var/www
RUN chown -R www-data /opt/actioncenter/public \
/opt/actioncenter/db \
/opt/actioncenter/tmp \
/opt/actioncenter/log \
/var/www
USER www-data
CMD ["rails", "s", "-b", "0.0.0.0"]
ENTRYPOINT ["/opt/actioncenter/docker/entrypoint.sh"]