-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
57 lines (36 loc) · 1.24 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
FROM ruby:2.7.0-slim
LABEL maintainer="Igor Zubkov <[email protected]>"
RUN set -eux; \
apt-get update -y ; \
apt-get dist-upgrade -y ; \
apt-get install git gcc g++ make libpq-dev --no-install-recommends -y ; \
apt-get autoremove -y ; \
apt-get clean -y ; \
rm -rf /var/lib/apt/lists/*
RUN mkdir -p /app
WORKDIR /app
COPY Gemfile Gemfile
COPY Gemfile.lock Gemfile.lock
ENV RAILS_ENV production
ENV RUBYGEMS_VERSION 3.1.2
RUN gem update --system "$RUBYGEMS_VERSION"
ENV BUNDLER_VERSION 2.1.4
RUN gem install bundler --version "$BUNDLER_VERSION" --force
# throw errors if Gemfile has been modified since Gemfile.lock
RUN bundle config set --global frozen 1
# two jobs
RUN bundle config set --global jobs 2
# install only production gems without development and test
RUN bundle config set --global without development test
# retry 5 times before fail
RUN bundle config set --global retry 5
RUN bundle install
#COPY package.json package.json
#
#COPY yarn.lock yarn.lock
#
#RUN yarn install
COPY . .
RUN bundle exec rake SECRET_KEY_BASE=blablabla DB_ADAPTER=nulldb DATABASE_URL="postgres://postgres@postgresql/evemonk_production?pool=1&encoding=unicode" assets:precompile
EXPOSE 3000/tcp
CMD ["rails", "server", "-b", "0.0.0.0"]