2022-12-01 09:57:24 -05:00
|
|
|
FROM ruby:3.1.3-alpine3.17
|
2021-11-13 21:31:26 -05:00
|
|
|
|
2021-11-16 15:32:40 -05:00
|
|
|
# Dependencies for setup and runtime
|
2022-12-01 09:57:24 -05:00
|
|
|
RUN apk --no-cache add nodejs yarn ffmpeg vips \
|
|
|
|
postgresql12-client postgresql12-dev \
|
|
|
|
bash build-base git glib-dev jemalloc tzdata
|
2022-04-21 14:22:15 -04:00
|
|
|
|
2022-12-07 03:07:39 -05:00
|
|
|
WORKDIR /app
|
|
|
|
|
|
|
|
RUN git config --global --add safe.directory $(pwd)
|
2022-04-25 15:01:58 -04:00
|
|
|
|
2022-12-01 09:57:24 -05:00
|
|
|
ENV LD_PRELOAD=/usr/lib/libjemalloc.so.2
|
2021-11-13 21:31:26 -05:00
|
|
|
|
2022-01-05 07:41:41 -05:00
|
|
|
# Install js packages and gems
|
|
|
|
COPY package.json yarn.lock ./
|
|
|
|
RUN yarn install
|
|
|
|
|
|
|
|
COPY Gemfile Gemfile.lock ./
|
2022-04-25 14:52:39 -04:00
|
|
|
RUN gem install bundler:2.3.12 && \
|
|
|
|
bundle install -j$(nproc)
|
2022-01-05 07:41:41 -05:00
|
|
|
|
2021-11-13 21:31:26 -05:00
|
|
|
# shoreman
|
2021-11-14 08:12:51 -05:00
|
|
|
RUN wget -O /usr/bin/shoreman https://github.com/chrismytton/shoreman/raw/master/shoreman.sh \
|
|
|
|
&& chmod +x /usr/bin/shoreman
|
2021-11-13 21:31:26 -05:00
|
|
|
|
2022-10-18 17:35:18 -04:00
|
|
|
|
|
|
|
# Only setup solargraph stuff when the profile is selected
|
|
|
|
ARG COMPOSE_PROFILES
|
|
|
|
RUN if [[ $COMPOSE_PROFILES == *"solargraph"* ]]; then \
|
|
|
|
solargraph download-core && bundle exec yard gems && solargraph bundle; \
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Stop bin/rails console from offering autocomplete
|
|
|
|
RUN echo "IRB.conf[:USE_AUTOCOMPLETE] = false" > ~/.irbrc
|
|
|
|
|
2021-11-13 21:31:26 -05:00
|
|
|
CMD [ "shoreman" ]
|