-
Notifications
You must be signed in to change notification settings - Fork 65
/
Dockerfile
52 lines (42 loc) · 1.21 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
ARG RUBY_VERSION=3.3.5
ARG ALPINE_VERSION=3.20
FROM ruby:$RUBY_VERSION-alpine$ALPINE_VERSION
ARG RAILS_VERSION=7.2.1
ENV SPOTLIGHT_ENGINE_PATH=/spotlight/engine
ENV SPOTLIGHT_GEM=/spotlight/engine
ENV RAILS_QUEUE=inline
RUN apk --no-cache upgrade && \
apk add --no-cache \
build-base \
curl \
gcompat \
git \
imagemagick \
less \
libxml2-dev \
libxslt-dev \
nodejs \
npm \
shared-mime-info \
sqlite-dev \
tini \
tzdata \
yarn \
zip
RUN addgroup --gid 10001 --system spotlight && \
adduser --uid 10000 --system \
--ingroup spotlight --home /spotlight spotlight
RUN npm i -g npx
USER spotlight
RUN gem update bundler
RUN gem install --no-document rails -v "${RAILS_VERSION}"
COPY --chown=10000:10001 . /spotlight/engine
WORKDIR /spotlight/engine
RUN bundle install --jobs "$(nproc)"
RUN mkdir -p /spotlight/app
WORKDIR /spotlight/app
RUN yarn add file:${SPOTLIGHT_GEM}
RUN SKIP_TRANSLATION=yes rails _${RAILS_VERSION}_ new . -a propshaft --force --template=../engine/template.rb
RUN SKIP_TRANSLATION=yes DB_ADAPTER=nulldb bundle exec rake assets:precompile
ENTRYPOINT ["/sbin/tini", "--", "/spotlight/engine/bin/docker-entrypoint.sh"]
CMD ["bundle", "exec", "puma", "-b", "tcp://0.0.0.0:3000"]