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-production
2.0 kB 68 lines
at autocoaching
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869ARG RUBY_VERSIONFROM ruby:$RUBY_VERSION-alpine AS builder
# Build base for gem's native extensions# tzdata for ruby timezone data# gcompat for ffi to load LSCRUN echo "http://dl-4.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories \ && apk update \ && apk add -u --no-cache build-base tzdata gcompat git postgresql-dev bash yarn \ && rm -rf /var/cache/apk/*
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
ENV RAILS_ENV=productionENV NODE_ENV=production
RUN gem update --system
RUN mkdir -p /appWORKDIR /app
COPY Gemfile* package.json yarn.lock ./
RUN bundle install --without development:test \ && rm -rf $BUNDLE_PATH/cache/*.gem \ && find $BUNDLE_PATH/gems/ -name "*.c" -delete \ && find $BUNDLE_PATH/gems/ -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 app/assets vendor/assets spec
#############
FROM ruby:$RUBY_VERSION-alpine
ENV RAILS_ENV=production \ NODE_ENV=production \ 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
RUN echo "http://dl-4.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories \ && apk update \ && apk add -u --no-cache tzdata gcompat postgresql-dev bash nodejs-current \ && rm -rf /var/cache/apk/*
COPY --from=builder /app /appCOPY --from=builder /bundle /bundle
WORKDIR /app