Dockerfile 1.0 KB

123456789101112131415161718192021222324252627282930
  1. FROM ubuntu:14.04
  2. COPY docker/scripts/prepare /scripts/
  3. RUN /scripts/prepare
  4. WORKDIR /app
  5. COPY ["Gemfile", "Gemfile.lock", "/app/"]
  6. COPY lib/gemfile_helper.rb /app/lib/
  7. COPY vendor/gems/ /app/vendor/gems/
  8. # Get rid of annoying "fatal: Not a git repository (or any of the parent directories): .git" messages
  9. RUN umask 002 && git init && \
  10. 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
  11. COPY ./ /app/
  12. ARG OUTDATED_DOCKER_IMAGE_NAMESPACE=false
  13. ENV OUTDATED_DOCKER_IMAGE_NAMESPACE ${OUTDATED_DOCKER_IMAGE_NAMESPACE}
  14. RUN umask 002 && \
  15. 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 && \
  16. chmod g=u /app/.env.example /app/Gemfile.lock /app/config/ /app/tmp/
  17. EXPOSE 3000
  18. COPY ["docker/scripts/setup_env", "docker/single-process/scripts/init", "/scripts/"]
  19. CMD ["/scripts/init"]
  20. USER 1001