forked from bigbluebutton/bbb-lti-broker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
61 lines (51 loc) · 1.36 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
FROM alpine:3.15 AS alpine
FROM alpine AS base
RUN apk add --no-cache \
libpq \
libxml2 \
libxslt \
libstdc++ \
ruby \
ruby-irb \
ruby-bigdecimal \
ruby-bundler \
ruby-json \
nodejs npm yarn \
tini \
tzdata \
shared-mime-info
WORKDIR /usr/src/app
FROM base as builder
RUN apk add --update --no-cache \
build-base \
libxml2-dev \
libxslt-dev \
pkgconf \
postgresql-dev \
ruby-dev \
yaml-dev \
zlib-dev \
curl-dev git \
&& ( echo 'install: --no-document' ; echo 'update: --no-document' ) >>/etc/gemrc
USER root
COPY . ./
RUN bundle config build.nokogiri --use-system-libraries \
&& bundle config set --local deployment 'true' \
&& bundle config set --local without 'development:test' \
&& bundle install -j4 \
&& rm -rf vendor/bundle/ruby/*/cache \
&& find vendor/bundle/ruby/*/gems/ \( -name '*.c' -o -name '*.o' \) -delete
FROM base AS application
USER root
ARG RAILS_ENV
ENV RAILS_ENV=${RAILS_ENV:-production}
COPY --from=builder /usr/src/app ./
ARG BUILD_NUMBER
ENV BUILD_NUMBER=${BUILD_NUMBER}
FROM application
EXPOSE 3000
# Precompile assets
# The assets are precompiled in runtime because RELATIVE_URL_ROOT can be set up through .env
# Run startup command
CMD ["scripts/start.sh"]
RUN SECRET_KEY_BASE=1 RAILS_ENV=production bundle exec rake assets:precompile --trace