-
Notifications
You must be signed in to change notification settings - Fork 30
/
Dockerfile
53 lines (39 loc) · 1.45 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
# Make sure it matches the Ruby version in .ruby-version and Gemfile
ARG RUBY_VERSION=3.2.0
FROM ruby:${RUBY_VERSION}-alpine
# Install libvips for Active Storage preview support
RUN apk add --no-cache build-base \
libxml2-dev \
libxslt-dev \
mariadb-dev \
git \
tzdata \
nodejs yarn \
less \
bash \
docker \
docker-compose \
&& mkdir /node_modules
# Rails app lives here
WORKDIR /app
# Set production environment
ARG RAILS_ENV="production"
ARG BUNDLE_WITHOUT="development test"
ENV RAILS_LOG_TO_STDOUT="1" \
RAILS_SERVE_STATIC_FILES="true" \
RAILS_ENV="${RAILS_ENV}" \
BUNDLE_PATH=/usr/local/bundle \
BUNDLE_WITHOUT="${BUNDLE_WITHOUT}"
RUN gem update --system 3.4.22 # the 3.4.22 can be removed if we support Ruby version > 3.0
COPY . .
RUN bundle install
RUN yarn install && yarn build
RUN cp config/bioportal_config_env.rb.sample config/bioportal_config_production.rb
RUN cp config/bioportal_config_env.rb.sample config/bioportal_config_development.rb
RUN cp config/database.yml.sample config/database.yml
# Precompile bootsnap code for faster boot times
RUN bundle exec bootsnap precompile --gemfile app/ lib/
RUN SECRET_KEY_BASE_DUMMY="1" ./bin/rails assets:precompile
ENV BINDING="0.0.0.0"
EXPOSE 3000
CMD ["bash"]