Dockerfile 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. FROM ubuntu:14.04
  2. COPY docker/scripts/prepare /scripts/
  3. RUN /scripts/prepare
  4. COPY docker/multi-process/scripts/standalone-packages /scripts/
  5. RUN /scripts/standalone-packages
  6. WORKDIR /app
  7. COPY ["Gemfile", "Gemfile.lock", "/app/"]
  8. COPY lib/gemfile_helper.rb /app/lib/
  9. COPY vendor/gems/ /app/vendor/gems/
  10. # Get rid of annoying "fatal: Not a git repository (or any of the parent directories): .git" messages
  11. RUN umask 002 && git init && \
  12. LC_ALL=en_US.UTF-8 RAILS_ENV=production APP_SECRET_TOKEN=secret DATABASE_ADAPTER=mysql2 ON_HEROKU=true bundle install --without test development --path vendor/bundle -j 4
  13. COPY ./ /app/
  14. ARG OUTDATED_DOCKER_IMAGE_NAMESPACE=false
  15. ENV OUTDATED_DOCKER_IMAGE_NAMESPACE ${OUTDATED_DOCKER_IMAGE_NAMESPACE}
  16. RUN umask 002 && \
  17. LC_ALL=en_US.UTF-8 RAILS_ENV=production APP_SECRET_TOKEN=secret DATABASE_ADAPTER=mysql2 ON_HEROKU=true bundle exec rake assets:clean assets:precompile && \
  18. chmod g=u /app/.env.example /app/Gemfile.lock /app/config/ /app/tmp/
  19. EXPOSE 3000
  20. COPY docker/multi-process/scripts/supervisord.conf /etc/supervisor/
  21. COPY ["docker/multi-process/scripts/bootstrap.conf", \
  22. "docker/multi-process/scripts/foreman.conf", \
  23. "docker/multi-process/scripts/mysqld.conf", "/etc/supervisor/conf.d/"]
  24. COPY ["docker/multi-process/scripts/bootstrap.sh", \
  25. "docker/multi-process/scripts/foreman.sh", \
  26. "docker/multi-process/scripts/init", \
  27. "docker/scripts/setup_env", "/scripts/"]
  28. CMD ["/scripts/init"]
  29. USER 1001
  30. VOLUME /var/lib/mysql