FROM registry.cn-hangzhou.aliyuncs.com/gitlink/ruby:2.4.5 ADD ./ /home/pdl/gitlink WORKDIR /home/pdl/gitlink RUN /bin/bash -l -c "source /etc/profile.d/rvm.sh" RUN /bin/bash -l -c 'gem sources --add https://gems.ruby-china.com/ --remove https://rubygems.org/' RUN /bin/bash -l -c 'gem update --system' RUN rm -rf Gemfile.lock RUN cp config/configuration.yml.example config/configuration.yml RUN cp config/database.yml.example config/database.yml RUN cp config/environments/production.rb.example config/environments/production.rb RUN cp config/secrets.yml.example config/secrets.yml RUN touch config/redis.yml RUN touch config/elasticsearch.yml RUN mkdir log RUN /bin/bash -l -c 'bundle install' #RUN /bin/bash -l -c 'RAILS_ENV=production rails db:create' #RUN /bin/bash -l -c 'RAILS_ENV=production bundle exec rake sync_table_structure:import_csv' #RUN /bin/bash -l -c 'RAILS_ENV=production rails db:migrate' #EXPOSE 4000 #RUN /bin/bash -l -c 'RAILS_ENV=production puma'