Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Base image:
- FROM ruby:2.5.1
- # Install dependencies
- RUN apt-get update -qq && apt-get install -y build-essential libpq-dev vim
- graphviz imagemagick wget curl
- RUN curl -sL https://deb.nodesource.com/setup_9.x | bash - &&
- apt-get install -y -f nodejs
- RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - &&
- echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
- # Set an environment variable where the Rails app is installed to inside of Docker image:
- ENV RAILS_ROOT /var/www/admin85
- # Set working directory, where the commands will be ran:
- WORKDIR $RAILS_ROOT
- # Install yarn for webpacker
- RUN npm install -g yarn
- # Gems:
- RUN gem install bundler
- COPY config/puma.rb config/puma.rb
- COPY Gemfile .
- COPY Gemfile.lock .
- COPY package.json .
- COPY yarn.lock .
- RUN bundle install --path $RAILS_ROOT/bundle --binstubs $RAILS_ROOT/bundle/bin
- RUN yarn install
- VOLUME ["$RAILS_ROOT"]
- FROM <ECR_URL>
- # Set an environment variable where the Rails app is installed to inside of Docker image:
- ENV RAILS_ROOT /var/www/admin85
- COPY . $RAILS_ROOT
- WORKDIR $RAILS_ROOT
- RUN bundle exec rake RAILS_ENV=production SECRET_BASE=abc123 assets:precompile
- EXPOSE 3000
- VOLUME ["$RAILS_ROOT/public"]
- CMD bundle exec puma -C config/puma.rb
- version: '2'
- services:
- postgres:
- image: postgres:9.6-alpine
- environment:
- POSTGRES_USER: app_user
- POSTGRES_PASSWORD: app_pass
- volumes:
- - postgres:/var/lib/postgresql/data
- selenium:
- image: selenium/standalone-chrome:latest
- web:
- build:
- context: .
- dockerfile: Dockerfile-nginx
- links:
- - app
- ports:
- - "80:80"
- mailcatcher:
- image: schickling/mailcatcher
- ports:
- - '1080:1080'
- app:
- build: .
- volumes:
- - .:/var/www/flagsilk
- environment:
- - DATABASE_NAME=flagsilk
- - DATABASE_USER=app_user
- - DATABASE_PASS=app_pass
- - DATABASE_HOST=postgres
- - DATABASE_PORT=5432
- - RAILS_ENV
- - SELENIUM_REMOTE_HOST=selenium
- expose:
- - "3000"
- depends_on:
- - 'postgres'
- - 'selenium'
- - 'mailcatcher'
- volumes:
- postgres:
Add Comment
Please, Sign In to add comment