-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
71 lines (51 loc) · 1.82 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
FROM ruby:2.7
LABEL maintainer="Michael Englehorn <[email protected]>"
ENV INSTALL_PATH /app
ARG RAILS_ENV="production"
ARG NODE_ENV="production"
RUN apt-get update -qq && apt-get install -y mariadb-client curl gnupg2 redis libmariadb-dev libsqlite3-dev git build-essential
RUN bash -c "set -o pipefail \
&& curl -sSL https://deb.nodesource.com/setup_16.x | bash - \
&& curl -sSL https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \
&& echo 'deb https://dl.yarnpkg.com/debian/ stable main' | tee /etc/apt/sources.list.d/yarn.list \
&& apt-get update && apt-get upgrade -y \
&& apt-get install -y --no-install-recommends nodejs yarn \
&& rm -rf /var/lib/apt/lists/* /usr/share/doc /usr/share/man \
&& apt-get clean \
&& useradd --create-home ruby \
&& mkdir /node_modules && chown ruby:ruby -R /node_modules"
RUN bash -c "set -o pipefail \
&& mkdir /app \
&& chown -R ruby:ruby /app"
USER ruby
WORKDIR /app
ARG BUILD_VER=unknown
#COPY . /app
#USER root
#RUN chown -R ruby:ruby /app
#USER ruby
#RUN rm -rf node_modules vendor
RUN gem install bundler -v '>= 1.3.0'
#RUN bundle install --jobs "$(nproc)"
#RUN yarn install
ENV RAILS_ENV="${RAILS_ENV}" \
NODE_ENV="${NODE_ENV}" \
PATH="${PATH}:/home/ruby/.local/bin:/node_modules/.bin" \
USER="ruby"
#COPY database.yml /app/config/database.yml
#COPY devise.rb /app/config/initializers/devise.rb
#RUN mkdir /app/config
#COPY master.key /app/config/master.key
#USER root
#RUN chown -R ruby:ruby /app/config/master.key
#USER ruby
ENV RAILS_SERVE_STATIC_FILES=1
#RUN bundle exec rake app:update:bin
#RUN if [ "${RAILS_ENV}" != "development" ]; then \
# rails assets:precompile; fi
#USER root
#COPY entrypoint.sh /usr/bin/
#RUN chmod +x /usr/bin/entrypoint.sh
#USER ruby
#ENTRYPOINT ["entrypoint.sh"]
#CMD ["rails", "server", "-b", "0.0.0.0", "-p", "3001"]