Tag: Docker/実践
FROM ruby:2.3.3 RUN apt-get update -qq && apt-get install -y build-essential libpq-dev nodejs RUN mkdir /myapp WORKDIR /myapp ADD Gemfile /myapp/Gemfile ADD Gemfile.lock /myapp/Gemfile.lock RUN bundle install ADD . /myapp
source 'https://rubygems.org' gem 'rails', '5.0.0.1'
touch Gemfile.lock
version: '2' services: db: image: postgres web: build: . command: bundle exec rails s -p 3000 -b '0.0.0.0' volumes: - .:/myapp ports: - "3000:3000" depends_on: - db
docker-compose run web rails new . --force --database=postgresql --skip-bundle
development: &default adapter: postgresql encoding: unicode database: myapp_development pool: 5 username: postgres password: host: db test: <<: *default database: myapp_test
docker-compose up
docker compose run web rake db:create
command: /bin/sh -c "rm -f tmp/pids/server.pid && rails server puma"
config.web_console.whitelisted_ips = '0.0.0.0/0'