-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathDockerfile
82 lines (63 loc) · 1.72 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
ARG RUBY_PATH=/usr/local/
ARG RUBY_VERSION=2.7.2
FROM ubuntu:16.04 AS rubybuild
ARG RUBY_PATH
ARG RUBY_VERSION
RUN apt-get update && \
apt-get install -y \
build-essential \
zlib1g \
zlib1g-dev \
libpq-dev \
libssl-dev \
libyaml-dev \
libxml2-dev \
libxslt1-dev \
libc6-dev \
libncurses5-dev \
libreadline-dev \
libtool \
make \
automake \
autoconf \
libffi-dev \
unzip \
imagemagick \
sed \
mawk \
curl \
openssl \
apt-transport-https \
ca-certificates \
musl-dev \
postgresql-client \
gnupg2 \
git
RUN curl -sL https://deb.nodesource.com/setup_lts.x | bash -
RUN apt-get install -y nodejs
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
RUN apt-get update && apt-get install -y yarn
RUN git clone git://github.com/rbenv/ruby-build.git $RUBY_PATH/plugins/ruby-build \
&& $RUBY_PATH/plugins/ruby-build/install.sh && \
ruby-build $RUBY_VERSION $RUBY_PATH
###############
FROM rubybuild
ARG RUBY_PATH
ENV PATH $RUBY_PATH/bin:$PATH
ENV APP_HOME /app
WORKDIR $APP_HOME
COPY --from=rubybuild $RUBY_PATH $RUBY_PATH
COPY Gemfile Gemfile.lock ./
RUN gem install bundler -v 2.0.2 && \
bundle config build.nokogiri --use-system-libraries && \
bundle check || bundle install
COPY package.json yarn.lock ./
RUN yarn install --check-files
COPY . $APP_HOME
# CMD ["bundle", "exec", "rails s -b 0.0.0.0"]
# ENTRYPOINT ["./entrypoints/docker-entrypoint.sh"]
# docker-compose up --build
# docker-compose exec app bundle exec rake db:setup
# docker-compose exec app bundle exec rake db:setup db:migrate
# https://ledermann.dev/blog/2018/04/19/dockerize-rails-the-lean-way/