2022-04-25 15:27:09 -04:00
|
|
|
FROM ruby:3.1.2-alpine
|
2021-11-13 21:31:26 -05:00
|
|
|
|
2021-11-16 15:32:40 -05:00
|
|
|
# Dependencies for setup and runtime
|
|
|
|
RUN apk --no-cache add nodejs yarn postgresql-client ffmpeg vips tzdata \
|
2022-04-22 12:25:01 -04:00
|
|
|
git build-base postgresql-dev glib-dev bash
|
2021-11-13 21:31:26 -05:00
|
|
|
|
2022-04-21 14:22:15 -04:00
|
|
|
RUN wget -O - https://github.com/jemalloc/jemalloc/releases/download/5.2.1/jemalloc-5.2.1.tar.bz2 | tar -xj && \
|
|
|
|
cd jemalloc-5.2.1 && \
|
|
|
|
./configure && \
|
|
|
|
make && \
|
|
|
|
make install
|
|
|
|
|
2022-04-25 15:01:58 -04:00
|
|
|
RUN git config --global --add safe.directory /app
|
|
|
|
|
2022-04-21 14:22:15 -04:00
|
|
|
ENV LD_PRELOAD=/usr/local/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
|
|
|
WORKDIR /app
|
|
|
|
CMD [ "shoreman" ]
|