forked from hexlet-basics/hexlet-basics
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.production
46 lines (32 loc) · 1.08 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
45
46
FROM ruby:3.1
# NOTE https://github.com/webpack/webpack/issues/14532
ENV NODE_OPTIONS --openssl-legacy-provider
ENV NODE_VERSION 17.x
ENV DOCKER_CHANNEL stable
ENV DOCKER_VERSION 20.10.14
ENV DISABLE_SPRING 1
RUN curl -sL https://deb.nodesource.com/setup_${NODE_VERSION} | bash -
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 \
build-essential \
libpq-dev \
libsqlite3-dev \
nodejs \
&& rm -rf /var/lib/apt/lists/*
RUN corepack enable
RUN yarn set version stable
# ENV BUNDLE_PATH /root/hexlet-basics/vendor/bundle
WORKDIR /app
COPY .yarnrc.yml .
COPY package.json .
COPY yarn.lock .
RUN yarn install
COPY Gemfile .
COPY Gemfile.lock .
RUN bundle install --jobs $(nproc)
COPY . .
RUN APP_HOST=example.test bin/rails js:routes:typescript
RUN npm run build
RUN APP_HOST=example.test NODE_ENV=production HEXLET_DOCKER_BUILD=1 RAILS_ENV=production SECRET_KEY_BASE=jopa bin/rails assets:precompile
CMD ["make", "start-production"]