forked from blindsidenetworks/scalelite
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
82 lines (73 loc) · 2.57 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
FROM alpine:3.11 AS alpine
FROM ubuntu:16.04 AS bbb-playback
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update \
&& apt-get install -y language-pack-en \
&& update-locale LANG=en_US.UTF-8
ENV LANG=en_US.UTF-8
RUN apt-get update \
&& apt-get install -y software-properties-common curl net-tools
RUN curl -sL https://ubuntu.bigbluebutton.org/repo/bigbluebutton.asc | apt-key add - \
&& echo "deb http://ubuntu.bigbluebutton.org/xenial-220/ bigbluebutton-xenial main" >/etc/apt/sources.list.d/bigbluebutton.list
RUN useradd --system --user-group --home-dir /var/bigbluebutton bigbluebutton
RUN touch /.dockerenv
RUN apt-get update \
&& apt-get download bbb-playback-notes bbb-playback-podcast bbb-playback-presentation bbb-playback-screenshare \
&& dpkg -i --force-depends *.deb
FROM alpine AS nginx
RUN apk add --no-cache nginx tini gettext \
&& ln -sf /dev/stdout /var/log/nginx/access.log \
&& ln -sf /dev/stderr /var/log/nginx/error.log
RUN rm /etc/nginx/conf.d/default.conf
COPY --from=bbb-playback /etc/bigbluebutton/nginx /etc/bigbluebutton/nginx/
COPY --from=bbb-playback /var/bigbluebutton/playback /var/bigbluebutton/playback/
COPY nginx /etc/nginx/
EXPOSE 80
EXPOSE 443
ENV NGINX_HOSTNAME=localhost
CMD [ "/etc/nginx/start", "-g", "daemon off;" ]
FROM alpine AS base
RUN apk add --no-cache \
libpq \
libxml2 \
libxslt \
ruby \
ruby-bigdecimal \
ruby-bundler \
ruby-json \
tini \
tzdata \
&& addgroup scalelite \
&& adduser -h /srv/scalelite -G scalelite -D scalelite
WORKDIR /srv/scalelite
FROM base as builder
RUN apk add --no-cache \
build-base \
libxml2-dev \
libxslt-dev \
pkgconf \
postgresql-dev \
ruby-dev \
&& ( echo 'install: --no-document' ; echo 'update: --no-document' ) >>/etc/gemrc
USER scalelite:scalelite
COPY --chown=scalelite:scalelite Gemfile* ./
RUN bundle config build.nokogiri --use-system-libraries \
&& bundle install --deployment --without development:test -j4 \
&& rm -rf vendor/bundle/ruby/*/cache \
&& find vendor/bundle/ruby/*/gems/ \( -name '*.c' -o -name '*.o' \) -delete
COPY --chown=scalelite:scalelite . ./
RUN rm -rf nginx
FROM base AS application
USER scalelite:scalelite
ENV RAILS_ENV=production RAILS_LOG_TO_STDOUT=1
COPY --from=builder --chown=scalelite:scalelite /srv/scalelite ./
ARG BUILD_NUMBER
ENV BUILD_NUMBER=${BUILD_NUMBER}
FROM application AS recording-importer
ENV RECORDING_IMPORT_POLL=true
CMD [ "bin/start-recording-importer" ]
FROM application AS poller
CMD [ "bin/start-poller" ]
FROM application AS api
EXPOSE 3000
CMD [ "bin/start" ]