Guest User

Untitled

a guest
Apr 10th, 2018
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.17 KB | None | 0 0
  1. # Base image:
  2. FROM ruby:2.5.1
  3.  
  4. # Install dependencies
  5. RUN apt-get update -qq && apt-get install -y build-essential libpq-dev vim
  6. graphviz imagemagick wget curl
  7.  
  8. RUN curl -sL https://deb.nodesource.com/setup_9.x | bash - &&
  9. apt-get install -y -f nodejs
  10.  
  11. RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - &&
  12. echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
  13.  
  14. # Set an environment variable where the Rails app is installed to inside of Docker image:
  15. ENV RAILS_ROOT /var/www/admin85
  16.  
  17. # Set working directory, where the commands will be ran:
  18. WORKDIR $RAILS_ROOT
  19.  
  20. # Install yarn for webpacker
  21. RUN npm install -g yarn
  22.  
  23. # Gems:
  24. RUN gem install bundler
  25.  
  26. COPY config/puma.rb config/puma.rb
  27.  
  28. COPY Gemfile .
  29. COPY Gemfile.lock .
  30.  
  31. COPY package.json .
  32. COPY yarn.lock .
  33.  
  34. RUN bundle install --path $RAILS_ROOT/bundle --binstubs $RAILS_ROOT/bundle/bin
  35. RUN yarn install
  36.  
  37. VOLUME ["$RAILS_ROOT"]
  38.  
  39. FROM <ECR_URL>
  40.  
  41. # Set an environment variable where the Rails app is installed to inside of Docker image:
  42. ENV RAILS_ROOT /var/www/admin85
  43.  
  44. COPY . $RAILS_ROOT
  45.  
  46. WORKDIR $RAILS_ROOT
  47.  
  48. RUN bundle exec rake RAILS_ENV=production SECRET_BASE=abc123 assets:precompile
  49.  
  50. EXPOSE 3000
  51.  
  52. VOLUME ["$RAILS_ROOT/public"]
  53.  
  54. CMD bundle exec puma -C config/puma.rb
  55.  
  56. version: '2'
  57. services:
  58. postgres:
  59. image: postgres:9.6-alpine
  60. environment:
  61. POSTGRES_USER: app_user
  62. POSTGRES_PASSWORD: app_pass
  63. volumes:
  64. - postgres:/var/lib/postgresql/data
  65.  
  66. selenium:
  67. image: selenium/standalone-chrome:latest
  68.  
  69. web:
  70. build:
  71. context: .
  72. dockerfile: Dockerfile-nginx
  73. links:
  74. - app
  75. ports:
  76. - "80:80"
  77.  
  78. mailcatcher:
  79. image: schickling/mailcatcher
  80. ports:
  81. - '1080:1080'
  82.  
  83. app:
  84. build: .
  85. volumes:
  86. - .:/var/www/flagsilk
  87. environment:
  88. - DATABASE_NAME=flagsilk
  89. - DATABASE_USER=app_user
  90. - DATABASE_PASS=app_pass
  91. - DATABASE_HOST=postgres
  92. - DATABASE_PORT=5432
  93. - RAILS_ENV
  94. - SELENIUM_REMOTE_HOST=selenium
  95. expose:
  96. - "3000"
  97. depends_on:
  98. - 'postgres'
  99. - 'selenium'
  100. - 'mailcatcher'
  101.  
  102. volumes:
  103. postgres:
Add Comment
Please, Sign In to add comment