-
Notifications
You must be signed in to change notification settings - Fork 99
/
Dockerfile.prod
50 lines (39 loc) · 1.61 KB
/
Dockerfile.prod
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
FROM node:14.17.3-buster AS build-dep
WORKDIR /srv/app
COPY package.json yarn.lock ./
RUN yarn install --production=true
FROM ruby:2.7.4-buster
LABEL maintainer="quepid_admin@opensourceconnections.com"
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
# Must have packages
RUN apt-get update -qq && apt-get install -y --no-install-recommends vim curl git tmux apt-transport-https ca-certificates \
&& rm -rf /var/lib/apt/lists/*
# Install Node
RUN curl -sL https://deb.nodesource.com/setup_10.x | bash
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 --no-install-recommends \
nodejs \
yarn \
ca-certificates \
bzip2 \
libfontconfig \
&& apt-get clean all \
&& rm -rf /var/lib/apt/lists/*
# Install dependencies
WORKDIR /srv/app
COPY Gemfile Gemfile.lock ./
RUN gem install bundler:1.17.3
#RUN bundle install
# Clean up Bundle
RUN bundle install --without development test && \
bundle clean --force && \
rm -rf /app/.bundle/cache && \
rm -rf /app/vendor/bundle/ruby/*/cache
COPY --from=build-dep /srv/app/node_modules ./node_modules/
COPY . .
RUN RAILS_ENV=production SECRET_KEY_BASE=fake_out_devise bundle exec rake assets:precompile
# Remove some files not needed in resulting image
RUN rm package.json yarn.lock
CMD ["foreman", "s", "-f", "Procfile"]