-
Notifications
You must be signed in to change notification settings - Fork 39
/
Dockerfile
67 lines (51 loc) · 2.03 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
FROM --platform=linux/amd64 instructure/ruby-passenger:3.3
ARG DEV_BUILD='false'
ENV APP_HOME /usr/src/app/
USER root
RUN echo "deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list \
&& curl --silent https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \
&& apt-get update -y \
&& apt-get install -y \
mariadb-client-10.3 \
postgresql-client-13 \
nodejs \
&& ([ "$DEV_BUILD" = 'true' ] \
&& apt-get install -y \
libqt4-dev \
libqtwebkit-dev \
|| true ) \
&& apt-get clean \
&& rm -rf \
/tmp/* \
/var/lib/apt/lists/* \
/var/tmp/*
RUN if [ "$DEV_BUILD" = 'true' ]; then apt-get update && apt-get install -y xvfb; fi
COPY config/nginx/location.conf /usr/src/nginx/location.d/location.conf
RUN if [ "$DEV_BUILD" = 'true' ]; then echo 'docker ALL=(ALL) NOPASSWD: SETENV: /usr/sbin/update-ca-certificates' >> /etc/sudoers; fi
RUN apt-get update && apt-get install -y build-essential
RUN apt-get update && apt-get install -yf firefox
RUN apt-get update && apt-get install wget && \
wget https://github.com/mozilla/geckodriver/releases/download/v0.17.0/geckodriver-v0.17.0-linux64.tar.gz && \
tar -zxvf geckodriver-v0.17.0-linux64.tar.gz && \
chmod +x geckodriver && \
mv geckodriver /usr/local/bin && \
rm geckodriver-v0.17.0-linux64.tar.gz
USER docker
COPY --chown=docker:docker Gemfile Gemfile.lock $APP_HOME
RUN gem install bundler -v 2.4.16
RUN bundle lock --add-platform ruby
RUN bundle lock --add-platform x86_64-linux
RUN bundle config build.nokogiri --use-system-libraries
RUN if [ "$DEV_BUILD" = 'false' ]; then BUNDLER_ARGS='--without development test'; fi; \
bundle install --jobs 8 $BUNDLER_ARGS
RUN mkdir -p tmp
COPY --chown=docker:docker . $APP_HOME
RUN RAILS_ENV=production \
DATABASE_URL=postgres://user:pass@127.0.0.1/does_not_exist_dbname \
LTI_KEY=12345 \
LTI_SECRET=secret \
CANVAS_KEY=1 \
CANVAS_SECRET=secret \
SECRET_KEY_BASE=fake \
bundle exec rake assets:precompile
ENTRYPOINT [ "/usr/src/app/docker-entrypoint.sh" ]