-
Notifications
You must be signed in to change notification settings - Fork 71
/
Dockerfile
40 lines (31 loc) · 941 Bytes
/
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
FROM ruby:3.1.4-alpine
ENV RAILS_ENV production
WORKDIR /app
# Update rubygems
RUN gem update --system
RUN printf "install: --no-rdoc --no-ri\nupdate: --no-rdoc --no-ri" > ~/.gemrc
RUN gem install --no-document --force bundler -v 2.4.21
# Install packages
RUN apk add --no-cache \
yarn \
ruby-dev \
build-base \
git \
nodejs \
postgresql-dev postgresql \
tzdata && \
cp /usr/share/zoneinfo/Asia/Tokyo /etc/localtime
# libvips
RUN apk add --no-cache vips-dev vips-heif orc-dev bash pngcrush optipng=0.7.8-r0 ghostscript-fonts
# Install npm packages
COPY package.json yarn.lock ./
RUN yarn install --production --ignore-engines
# Install gems
COPY Gemfile Gemfile.lock ./
RUN bundle install -j4
# Compile assets
COPY . ./
RUN SECRET_KEY_BASE=dummy NODE_OPTIONS=--openssl-legacy-provider bin/rails assets:precompile
ENV PORT 3000
EXPOSE 3000
CMD bin/rails server -p $PORT -e $RAILS_ENV