forked from ontoportal/ontoportal_web_ui
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathDockerfile
50 lines (36 loc) · 913 Bytes
/
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
FROM ruby:2.7.5-alpine AS app
WORKDIR /app
ARG UID=1000
ARG GID=1000
RUN apk add --no-cache \
build-base \
libxml2-dev \
libxslt-dev \
mariadb-dev \
git \
nodejs \
tzdata \
yarn \
less \
&& addgroup --gid ${GID} ruby \
&& adduser -u ${UID} -G ruby -D ruby \
&& chown ruby:ruby -R /app \
&& mkdir /node_modules \
&& chown ruby:ruby -R /node_modules /app
USER ruby
COPY --chown=ruby:ruby bin/ ./bin
RUN chmod 0755 bin/*
ARG RAILS_ENV="production"
ENV RAILS_ENV="${RAILS_ENV}" \
NODE_ENV="${NODE_ENV}" \
PATH="${PATH}:/home/ruby/.local/bin:/node_modules/.bin" \
USER="ruby" \
BUNDLE_PATH=/usr/local/bundle
COPY --chown=ruby:ruby Gemfile* ./
RUN bundle install --jobs "$(nproc)"
RUN gem install rails
RUN echo "--modules-folder /node_modules" > .yarnrc
COPY --chown=ruby:ruby package.json *yarn* ./
RUN yarn install
EXPOSE 3000
CMD ["sh"]