-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
30 lines (21 loc) · 961 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
FROM ruby:3.3.5-alpine3.20
# bash is required for build scripts
# tzdata is a runtime dependency for ActiveSupport
# postgresql-libs is a runtime dependency for the database
# gcompat is needed for Nokogiri pre-built gems to work
RUN gem install bundler -v '~>2.3' && \
bundle config --global frozen 1 && \
apk add --no-cache coreutils bash tzdata postgresql-libs postgresql14-client gcompat && \
truncate -s 0 /var/log/*log
WORKDIR /app
COPY Gemfile Gemfile.lock ./
# Temporarily add the dev packages required for to install bundles (and remove the build cache afterwards )
RUN apk add --no-cache --virtual .gem-installdeps build-base git postgresql-dev && \
bundle install -j6 && \
rm -rf $GEM_HOME/cache && \
apk del .gem-installdeps
RUN addgroup --gid 1000 ruby && \
adduser --disabled-password --home /home/ruby --gecos "" --ingroup ruby --uid 1000 ruby
COPY . /app
RUN chmod -R 777 /app/tmp /app/log
USER 1000