forked from rubygems/rubygems.org
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
58 lines (41 loc) · 1.11 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
FROM ruby:2.6-alpine as build
RUN apk add --no-cache \
ruby \
nodejs \
postgresql-client \
postgresql-dev \
ca-certificates \
ruby-dev \
build-base \
bash \
linux-headers \
zlib-dev \
libxml2-dev \
libxslt-dev \
tzdata \
&& rm -rf /var/cache/apk/*
RUN mkdir -p /app /app/config
WORKDIR /app
RUN gem update --system 2.6.10
COPY . /app
ADD https://github.com/bundler/bundler-api/raw/master/versions.list /app/config/versions.list
RUN mv /app/config/database.yml.example /app/config/database.yml
RUN gem install bundler io-console --no-ri --no-rdoc && bundle install --jobs 20 --retry 5 --without deploy
RUN RAILS_ENV=production SECRET_KEY_BASE=1234 bin/rails assets:precompile
FROM ruby:2.6-alpine
RUN apk add --no-cache \
ruby \
nodejs \
postgresql-client \
ca-certificates \
bash \
tzdata \
&& rm -rf /var/cache/apk/*
RUN mkdir -p /app
WORKDIR /app
COPY --from=build /usr/local/bin/gem /usr/local/bin/gem
COPY --from=build /usr/local/bundle/ /usr/local/bundle/
COPY --from=build /app/ /app/
EXPOSE 3000
ENTRYPOINT ["bundle", "exec"]
CMD ["rails", "server", "-b", "0.0.0.0"]