forked from rubygems/rubygems.org
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
62 lines (42 loc) · 1.35 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
FROM ruby:3.0-alpine as build
ARG RUBYGEMS_VERSION
RUN apk add --no-cache \
nodejs \
postgresql-dev \
ca-certificates \
build-base \
bash \
linux-headers \
zlib-dev \
tzdata \
&& rm -rf /var/cache/apk/*
RUN mkdir -p /app /app/config /app/log/
WORKDIR /app
RUN gem update --system $RUBYGEMS_VERSION
COPY Gemfile* /app/
RUN bundle config set --local without 'development test' && \
bundle install --jobs 20 --retry 5
COPY . /app/
ADD https://s3-us-west-2.amazonaws.com/oregon.production.s3.rubygems.org/versions/versions.list /app/config/versions.list
ADD https://s3-us-west-2.amazonaws.com/oregon.production.s3.rubygems.org/stopforumspam/toxic_domains_whole.txt /app/vendor/toxic_domains_whole.txt
RUN mv /app/config/database.yml.sample /app/config/database.yml
RUN RAILS_ENV=production RAILS_GROUPS=assets SECRET_KEY_BASE=1234 bin/rails assets:precompile
RUN bundle config set --local without 'development test assets' && \
bundle clean --force
FROM ruby:3.0-alpine
ARG RUBYGEMS_VERSION
RUN apk add --no-cache \
libpq \
ca-certificates \
bash \
tzdata \
xz-libs \
&& rm -rf /var/cache/apk/*
RUN gem update --system $RUBYGEMS_VERSION
RUN mkdir -p /app
WORKDIR /app
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"]