Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 1 app:
- 2 build: .
- 3
- 4 env_file: .env.production
- 5
- 6 environment:
- 7 RAILS_ENV: $RAILS_ENV
- 8
- 9 links:
- 10 - db
- 11
- 14 expose:
- 15 - "3000"
- 16
- 17 db:
- 18 image: postgres:9.4.5
- 19
- 20 volumes:
- 21 - eshop-postgres:/var/lib/postgresql/data
- 22
- 23 web:
- 24 build: .
- 25
- 26 dockerfile: config/containers/Dockerfile-nginx
- 27
- 28 volumes:
- 29 - ./public:/var/www/eshop/public
- 30
- 31 links:
- 32 - app
- 33 ports:
- 34 - "80:80"
- 2 FROM ruby:2.3.3-slim
- 12 RUN apt-get update -qq && apt-get install -y build-essential libpq-dev postgresql-client libsqlite3-dev nodejs vim
- 15 ENV RAILS_ROOT /var/www/myapp
- 18 RUN mkdir -p $RAILS_ROOT/tmp/pids
- 19
- 21 WORKDIR $RAILS_ROOT
- 22
- 26 COPY Gemfile Gemfile
- 27
- 28 COPY Gemfile.lock Gemfile.lock
- 29
- 31 RUN gem install bundler
- 32
- 34 RUN bundle install
- 35
- 37 COPY . .
- 38
- 39 - RUN RAILS_ENV=production bundle exec rake assets:precompile --trace~
- 40 - RUN bundle exec rake assets:precompile --trace~
- 40 + RUN bundle exec rake RAILS_ENV=$RAILS_ENV DATABASE_URL=postgresql://$POSTGRES_USER:$POSTGRES_PASSWORD@127.0.0.1/$POSTGRES_PRODUCTION_DB assets:precompile
- 41 + VOLUMES ["$RAILS_ROOT/public"]
- 46 + CMD [ "config/containers/app_cmd.sh" ]
- 2 FROM nginx
- 12 RUN apt-get update -qq && apt-get -y install apache2-utils vim
- 15 ENV RAILS_ROOT /var/www/myapp
- 18 WORKDIR $RAILS_ROOT
- 21 RUN mkdir log
- 25 COPY public public/
- 28 COPY config/containers/nginx.conf /tmp/myapp.nginx
- 32 RUN envsubst '$RAILS_ROOT' < /tmp/myappv.nginx > /etc/nginx/conf.d/default.conf
- 35 CMD [ "nginx", "-g", "daemon off;" ]
- 40 RUN bundle exec rake RAILS_ENV=$RAILS_ENV DATABASE_URL=postgresql://$POSTGRES_USER:$POSTGRES_PASSWORD@127.0.0.1/$POSTGRES_PRODUCTION_DB assets:precompile
- 41 VOLUME ["$RAILS_ROOT/public"]
- 46 CMD [ "config/containers/app_cmd.sh" ]
- # *.env.production*
- RAILS_ENV=production
- RAILS_ROOT=/var/www/eshop
- SECRET_KEY_BASE=the_long_code
- POSTGRES_PRODUCTION_DB=production_db
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=keep_secret_ps
- web_1 | 2017/03/02 05:45:14 [warn] 1#1: server name "/var/www/eshop/public" has suspicious symbols in /etc/nginx/conf.d/default.conf:16
- web_1 | nginx: [warn] server name "/var/www/eshop/public" has suspicious symbols in /etc/nginx/conf.d/default.conf:16
- RUN bundle exec rake RAILS_ENV=production DATABASE_URL=postgresql://user:pass@127.0.0.1/dbname SECRET_TOKEN=makeupasecret assets:precompile
- VOLUME ["$RAILS_ROOT/public"]
- version: '2'
- services:
- app:
- ...
- environment:
- - RAILS_SERVE_STATIC_FILES=true
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement