FROM ruby:2.6-alpine RUN apk add --no-cache \ git \ build-base \ tzdata \ nodejs \ yarn \ sqlite-dev \ bash \ postgresql-dev WORKDIR /app ENV GIT_HASH 78525f7281534674e5a987db805c2805f477b7f4 ENV RAILS_SERVE_STATIC_FILES=true ENV RAILS_ENV production ENV RACK_ENV production ENV NODE_ENV production ENV SECRET_KEY_BASE="08898973823f6f1d121ce30fb8adc1c559dcfc08f358cfc0298e4aad81b8c9d798e8249e3a4b26c04255cf8b2d71eaf8eda865d173ae3fe6fb1a599d1b1fa260" RUN git clone https://github.com/snibox/snibox.git /app && cd /app && git reset --hard $GIT_HASH COPY . /app RUN echo "gem 'sqlite3', '~> 1.3.6'" >> Gemfile && gem install bundler && bundle install VOLUME /app/db/database RUN yarn install --check-files; bundle exec rake assets:precompile EXPOSE 3000 CMD cd /app && rake 'db:migrate' && bundle exec rails server -b 0.0.0.0