B
B
Bogdan2018-08-30 21:55:15
Ruby on Rails
Bogdan, 2018-08-30 21:55:15

Rails 5.2.1 and Docker?

Hello. Please tell me what could be the problem. I use Rails 5.2.1 Running Docker does not pick up changes in files, I have to restart docker. Although in version Rails 5.2.0 everything works fine. I did not make any settings, I created the project with the command 'rails new my_api --api'
There is a suspicion of the spring gem, I already tried it and removed it, but added it again, but it did not help.

gemfile

source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
ruby '2.5.1'
gem 'rails', '~> 5.2.1'
gem 'pg'
gem 'bootsnap', '>= 1.1.0', require: false
# gem 'passenger', require: "phusion_passenger/rack_handler"
gem 'puma'
group :development, :test do
gem 'listen', '>= 3.0.5', '< 3.2'
gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
gem 'spring', ' >= 2.0.2'
end
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]

dockercomose.yml

version: '3.6'
services:
db:
image: postgres:10.5-alpine
ports:
- $POSTGRES_PORT:$POSTGRES_PORT
volumes:
- postgres:/var/lib/postgresql/data
environment:
POSTGRES_USER: $POSTGRES_USER
POSTGRES_PASSWORD: $POSTGRES_PASSWORD
POSTGRES_DB: $POSTGRES_DB
POSTGRES_PORT: $POSTGRES_PORT
app:
build:
context: ./
command: >
bash -c "
bundle check
|| bundle install --clean
&& rm -f tmp/pids/server.pid
&& bundle exec rails db:migrate
&& bundle exec rails db:seed
&& bundle exec bin/spring rails server"
ports:
- $PORT:$PORT
volumes:
- .:/app
environment:
DATABASE_URL: postgresql://$POSTGRES_USER:[email protected]$POSTGRES_HOST:$POSTGRES_PORT/$POSTGRES_DB?pool=$POSTGRES_POOL
BUNDLE_PATH: /app/gems
env_file: .env
depends_on:
- db
nginx:
image: nginx:latest
depends_on:
- app
volumes:
- ./nginx.conf:/etc/nginx/conf.d/default.conf:ro
ports:
- 8099:8099
volumes:
postgres:

Thank you.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question