This repository was archived by the owner on Apr 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathDockerfile
More file actions
53 lines (41 loc) · 1.46 KB
/
Dockerfile
File metadata and controls
53 lines (41 loc) · 1.46 KB
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
FROM ruby:2.3-slim
RUN mkdir -p /opt/fab /opt/fab/tmp
WORKDIR /opt/fab
ARG BUILD_ENV=production
RUN if [ "$BUILD_ENV" = "development" ]; then \
adduser -Du 1000 -h /opt/fab www-data; \
else \
adduser -DS -h /opt/fab www-data; \
fi
RUN apt-get update && apt-get install -y \
curl \
build-essential \
libmysqlclient-dev \
mysql-client \
libfontconfig \
nodejs \
cron
# 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 Gemfile* ./
RUN bundle install
COPY . .
COPY docker/crontab /etc/cron.d/crontab
RUN chmod 0644 /etc/cron.d/crontab
RUN if [ "$BUILD_ENV" = "production" ]; \
then bundle exec rake assets:precompile \
RAILS_ENV=production \
SECRET_KEY_BASE=noop; fi
RUN mkdir -p /var/www /opt/fab/files \
&& chown -R www-data /opt/fab/public \
/opt/fab/tmp \
/var/www \
/usr/local/bundle
USER www-data
CMD ["rails", "s", "-b", "0.0.0.0"]
ENTRYPOINT ["/opt/fab/entrypoint.sh"]