forked from ufcvirtual/solar
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
71 lines (57 loc) · 1.37 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
ARG RUBY_PATH=/usr/local/
ARG RUBY_VERSION=2.3.8
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 \
curl
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 1.17.3 && \
bundle config build.nokogiri --use-system-libraries && \
bundle check || bundle install
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/