anchor.diff:  # add elektra sources into image
   ADD . $APP_PATH
   
  -# We use dummy master.key to workaround the fact that
  -# assets:precompile needs them but we don't want the real master.key to be built
  -# into the container. The MONSOON_RAILS_SECRET_TOKEN should be injected as env var when starting the
  -# container.
  -# https://github.com/rails/rails/issues/32947
  -ENV MONSOON_RAILS_SECRET_TOKEN=dummy_monsoon_rails_build_secret_token_for_assets_precompiling_change_it_in_production
  -ARG MONSOON_RAILS_SECRET_TOKEN
  -ENV MONSOON_RAILS_SECRET_TOKEN=$MONSOON_RAILS_SECRET_TOKEN
  -
   # transpile javascripts
   #RUN yarn install --no-progress && yarn build --production && rm -rf node_modules
   RUN bin/rails assets:precompile && rm -rf tmp/cache/assets node_modules
   
   ############################ TEST IMAGE ##########################
  -FROM builder AS tests
  +FROM base AS tests
   RUN apk add --no-cache postgresql bash
   ENV RAILS_ENV=test
  +# Copy the already built bundler artifact
  +COPY --from=builder /usr/local/bundle/ /usr/local/bundle/
  +# Copy the already built js artifact
  +COPY --from=builder $APP_PATH $APP_PATH
  +
   RUN LISTENTO=127.0.0.1 su postgres -c 'script/pg_tmp.sh -p 5432 -w 300 -d /tmp/pg start' \
         && rake db:create db:migrate \
         && bundle exec rspec \
  
positive.code: 
  ENV APP_PATH=/home/app
  ENV RAILS_ENV=production
  WORKDIR $APP_PATH
  
  
  FROM base AS builder 
  RUN apk --no-cache add git curl tzdata nodejs postgresql-client yarn shared-mime-info
  
  
negative.code: 
  
  ######################################### FINAL IMAGE ######################################
  FROM base AS elektra
  LABEL source_repository="https://github.com/sapcc/elektra"
  
  # Copy the already built bundler artifact
  COPY --from=builder /usr/local/bundle/ /usr/local/bundle/
  