Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/glacials/splits-io. a speedrunning data store and analysis engine splits.io
Something went wrong. Try again.
splits-io Dockerfile
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869ARG RUBY_VERSIONFROM ruby:$RUBY_VERSION AS builder
# Install node/npmRUN curl -sL https://deb.nodesource.com/setup_13.x | bash -RUN apt-get install -y nodejs
# Install yarnRUN curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.listRUN apt-get update && apt-get install yarn
ENV LANG C.UTF-8ENV GEM_HOME /bundleENV BUNDLE_PATH $GEM_HOMEENV BUNDLE_APP_CONFIG $BUNDLE_PATHENV BUNDLE_BIN $BUNDLE_PATH/bin# Add bundle dir to path to be able to access commands outside of `bundle exec`ENV PATH /app/bin:$BUNDLE_BIN:$PATH
RUN gem update --system
RUN mkdir -p /appWORKDIR /app
COPY Gemfile* package.json yarn.lock ./
RUN bundle install -j "$(expr "$(getconf _NPROCESSORS_ONLN)" - 1)" --without development:test \ && rm -rf $BUNDLE_PATH/cache/*.gem \ && find $(bundle list --paths) -name "*.c" -delete \ && find $(bundle list --paths) -name "*.o" -delete
RUN yarn installCOPY . .ARG SPLITSIO_CLIENT_IDARG STRIPE_PUBLISHABLE_KEYRUN DATABASE_URL=nulldb://host/db SECRET_KEY_BASE="$(bundle exec rails secret)" \ REDIS_URL=redis://redis:6379/1 \ SPLITSIO_CLIENT_ID=$SPLITSIO_CLIENT_ID STRIPE_PUBLISHABLE_KEY=$STRIPE_PUBLISHABLE_KEY \ bin/rails assets:precompile
RUN rm -rf node_modules/ tmp/cache vendor/assets spec
#############
FROM ruby:$RUBY_VERSION AS runtime
ENV LANG=C.UTF-8 \ GEM_HOME=/bundleENV BUNDLE_PATH=$GEM_HOMEENV BUNDLE_APP_CONFIG=$BUNDLE_PATH \ BUNDLE_BIN=$BUNDLE_PATH/bin# Add bundle dir to path to be able to access commands outside of `bundle exec`ENV PATH=/app/bin:$BUNDLE_BIN:$PATH
# Install node/npmRUN curl -sL https://deb.nodesource.com/setup_13.x | bash -RUN apt-get install -y nodejs
# Install yarnRUN curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.listRUN apt-get update && apt-get install yarn
COPY --from=builder /app /appCOPY --from=builder /bundle /bundle
WORKDIR /app