forked from hexlet-basics/hexlet-basics
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.production
44 lines (28 loc) · 1.15 KB
/
Dockerfile.production
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
FROM ruby:3.0.1
RUN apt-get update \
&& apt-get install -y build-essential libpq-dev libsqlite3-dev
RUN curl -sL https://deb.nodesource.com/setup_16.x | bash -
ENV DOCKER_CHANNEL stable
ENV DOCKER_VERSION 20.10.6
RUN curl -fsSL "https://download.docker.com/linux/static/${DOCKER_CHANNEL}/x86_64/docker-${DOCKER_VERSION}.tgz" \
| tar -xzC /usr/local/bin --strip=1 docker/docker
RUN apt-get update && apt-get install -y nodejs
RUN npm install -g npm-check-updates
RUN npm install -g yarn
RUN yarn set version berry
# RUN yarn config set --home enableTelemetry 0
ENV BUNDLE_PATH /root/hexlet-basics/vendor/bundle
WORKDIR /root/hexlet-basics
RUN bundle config build.nokogiri --use-system-libraries
COPY package.json .
COPY yarn.lock .
RUN yarn install
COPY Gemfile .
COPY Gemfile.lock .
# RUN bundle config set without 'development'
RUN bundle install --jobs $(nproc)
COPY . .
RUN NODE_ENV=production HEXLET_DOCKER_BUILD=1 RAILS_ENV=production SECRET_KEY_BASE=jopa bin/rails assets:precompile
RUN NODE_ENV=test HEXLET_DOCKER_BUILD=1 RAILS_ENV=test SECRET_KEY_BASE=jopa bin/rails assets:precompile
VOLUME /var/tmp/hexletbasics
CMD ["make", "start-production"]