eBooru/Dockerfile
Earlopain 179a948cf2
[Docker] Add solargraph to the image, and a few more things
* Allow modifying .env without git complainging about changes to commit
* Require COMPOSE_PROFILE=solargraph for solargraph to be included in the image
* Set required vscode settings for solargraph to correctly work in docker
* Clean up .solargraph.yml. All these removed values are the default
* Disable autocomplete in the rails console
* Add a compose service to run rubocop

* Upddate rubocop config

Added some, removed some, ordered alphabetically.
Before: 844 files inspected, 6871 offenses detected, 6095 offenses autocorrectable
After: 844 files inspected, 8024 offenses detected, 7538 offenses autocorrectable
Most of the new offences are because of Style/StringLiterals (1312)
2022-10-18 23:35:18 +02:00

41 lines
1.1 KiB
Docker

FROM ruby:3.1.2-alpine
# Dependencies for setup and runtime
RUN apk --no-cache add nodejs yarn postgresql-client ffmpeg vips tzdata \
git build-base postgresql-dev glib-dev bash
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
RUN git config --global --add safe.directory /app
ENV LD_PRELOAD=/usr/local/lib/libjemalloc.so.2
# Install js packages and gems
COPY package.json yarn.lock ./
RUN yarn install
COPY Gemfile Gemfile.lock ./
RUN gem install bundler:2.3.12 && \
bundle install -j$(nproc)
# shoreman
RUN wget -O /usr/bin/shoreman https://github.com/chrismytton/shoreman/raw/master/shoreman.sh \
&& chmod +x /usr/bin/shoreman
# 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
WORKDIR /app
CMD [ "shoreman" ]