-
-
Notifications
You must be signed in to change notification settings - Fork 537
/
Dockerfile
67 lines (53 loc) · 1.76 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
ARG RUBY_VERSION=3.3
FROM ruby:${RUBY_VERSION} AS base
WORKDIR /app
RUN touch /etc/app-env
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 netcat-openbsd
RUN gem install bundler
RUN mkdir /app/log
COPY COPYING /app/
COPY config /app/config/
COPY config/database.docker.yml /app/config/database.yml
COPY config/site.docker.yml /app/config/site.yml
COPY bin /app/bin/
COPY script /app/script/
COPY public /app/public/
COPY vendor /app/vendor/
COPY .yardopts /app/
COPY Rakefile /app/
COPY config.ru /app/
COPY docker-entrypoint.sh /app/
COPY lib /app/lib/
COPY app /app/app/
COPY db /app/db/
# Use glob to omit error if the .git directory doesn't exists (in case the
# code is from a release archive, not a Git clone)
COPY .gi[t] /app/.git
COPY Gemfile* /app/
ENTRYPOINT ["/app/docker-entrypoint.sh"]
EXPOSE 3000
CMD ["./bin/rails", "server", "-b", "0.0.0.0"]
FROM base AS precompile
RUN bundle config set deployment true
RUN bundle install --jobs 4
RUN RAILS_GROUPS=assets bundle exec rake assets:precompile
# Build the environment-specific stuff
FROM base AS production
RUN bundle config set without assets
RUN bundle config --global frozen 1
RUN bundle install --jobs 4
COPY --from=precompile /app/public/assets /app/public/assets
FROM base AS test
COPY test /app/test/
# For testing the API client
COPY doc /app/doc/
RUN bundle config set without assets
RUN bundle config set with development test
RUN bundle config --global frozen 1
RUN bundle install --jobs 4
COPY --from=precompile /app/public/assets /app/public/assets
FROM base AS development
RUN bundle config set with development test
RUN bundle install --jobs 4