forked from instructure/canvas-lms
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.puma
94 lines (82 loc) · 3.16 KB
/
Dockerfile.puma
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
88
89
90
91
92
93
94
# GENERATED FILE, DO NOT MODIFY!
# To update this file please edit the relevant template and run the generation
# task `build/dockerfile_writer.rb --env development --compose-file docker-compose.yml,docker-compose.override.yml,docker-compose/puma.override.yml --in build/Dockerfile.puma.template --out Dockerfile.puma`
ARG RUBY=3.1
FROM instructure/ruby:$RUBY
LABEL maintainer="Instructure"
ARG RUBY
ARG POSTGRES_CLIENT=14
ENV APP_HOME /usr/src/app/
ENV RAILS_ENV development
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US.UTF-8
ENV LC_CTYPE en_US.UTF-8
ENV LC_ALL en_US.UTF-8
ARG CANVAS_RAILS=7.0
ENV CANVAS_RAILS=${CANVAS_RAILS}
ENV NODE_MAJOR 18
ENV NODE_OPTIONS=--openssl-legacy-provider
ENV YARN_VERSION 1.19.1-1
ENV GEM_HOME /home/docker/.gem/$RUBY
ENV PATH ${APP_HOME}bin:$GEM_HOME/bin:$PATH
ENV BUNDLE_APP_CONFIG /home/docker/.bundle
WORKDIR $APP_HOME
USER root
ARG USER_ID
# This step allows docker to write files to a host-mounted volume with the correct user permissions.
# Without it, some linux distributions are unable to write at all to the host mounted volume.
RUN if [ -n "$USER_ID" ]; then usermod -u "${USER_ID}" docker \
&& chown --from=9999 docker /usr/src/app -R; fi
RUN mkdir -p /etc/apt/keyrings \
&& curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg \
&& echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_${NODE_MAJOR}.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list \
&& curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \
&& echo "deb https://dl.yarnpkg.com/debian/ stable main" > /etc/apt/sources.list.d/yarn.list \
&& printf 'path-exclude /usr/share/doc/*\npath-exclude /usr/share/man/*' > /etc/dpkg/dpkg.cfg.d/01_nodoc \
&& echo "deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list \
&& curl -sS https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \
&& add-apt-repository ppa:git-core/ppa -ny \
&& apt-get update -qq \
&& apt-get install -qqy --no-install-recommends \
nodejs \
yarn="$YARN_VERSION" \
libxmlsec1-dev \
python3-lxml \
python-is-python3 \
libicu-dev \
libidn11-dev \
parallel \
postgresql-client-$POSTGRES_CLIENT \
unzip \
pbzip2 \
fontforge \
git \
build-essential \
&& rm -rf /var/lib/apt/lists/* \
&& mkdir -p /home/docker/.gem/ruby/$RUBY_MAJOR.0
RUN gem install bundler --no-document -v 2.5.6 \
&& find $GEM_HOME ! -user docker | xargs chown docker:docker
RUN npm install -g [email protected] && npm cache clean --force
USER docker
RUN set -eux; \
mkdir -p \
.yardoc \
app/stylesheets/brandable_css_brands \
app/views/info \
config/locales/generated \
log \
node_modules \
packages/js-utils/es \
packages/js-utils/lib \
packages/js-utils/node_modules \
pacts \
public/dist \
public/doc/api \
public/javascripts/translations \
reports \
tmp \
/home/docker/.bundle/ \
/home/docker/.cache/yarn \
/home/docker/.gem/
EXPOSE 80
CMD bundle exec rails server -b 0.0.0.0 -p 80