I want to reflect the changes in public/robots.txt
Rails is set up with docker.
Even if you change the contents of public/robots.txt
https: //localhost/robots.txtNot reflected in
It will be reflected when you enter bash in docker and change robots.txt
I think it's probably a docker volume issue,
I don't know what can be fixed and how to find out what to look for.
What I tried
version: "3.8" services: services: web: image: nginx: 1.18 ports: ports: -"80:80" volumes: --./docker/nginx/default.conf:/etc/nginx/conf.d/default.conf --public:/myapp/public --log:/var/log/nginx depends_on: --app db: image: postgres: 11.0-alpine volumes: --postgres:/var/lib/postgresql/data: cached ports: ports: -"5432: 5432" environment: environment: TZ: Asia/Tokyo app: build: context: .. image: rails_app tty: true stdin_open: true command: bash -c "rm -f tmp/pids/server.pid&&./bin/rails s -p 3000 -b '0.0.0.0'" volumes: --.:/Myapp: cached --rails_cache:/myapp/tmp/cache: cached --node_modules:/myapp/node_modules: cached --yarn_cache: /usr/local/share/.cache/yarn/v6:cached --bundle:/bundle: cached --public:/myapp/public --log:/myapp/log tmpfs: -/ tmp ports: ports: -"3000: 3000" environment: environment: depends_on: --db --webpacker webpacker: image: rails_app command: ./bin/webpack-dev-server volumes: --.:/Myapp: cached --public:/myapp/public --node_modules:/myapp/node_modules: cached environment: environment: tty: false stdin_open: false ports: ports: -"3035:30 35" volumes: rails_cache: node_modules: yarn_cache: postgres: bundle: bundle: public: log: log:
docker-compose down -v
docker-compose up -d
It was reflected when I did.
Answer # 1
Files on the host side on the host side
robots.txtYou mean editing?
The above question didn't hit the mark. Excuse me.
In the current definition of docker-compose.yml, the public volume managed by Docker is mounted on/webapp/public, so it looks like the file on the host side is not mounted on Docker side.
If you delete the definition of public volume from the definition of volumes of the web container and do as follows, the question will behave as intended.
volumes: --.:/Webapp: cached
Below is a snake leg.
However, if you do this, the output to the public volume that is also mounted in the webpacker container will not be readable by the web container (nginx), so I think that webpacker will not work as intended.
You can meet the requirement to edit robots.txt on the guest side, but I think this is what you want to achieve in the end.
I hope it gives you some hints.
- ruby on rails - in the development of docker + rails + puma + nginx, i want to check the puma log in real time (also for debuggi
- [docker, rails, nginx, mysql, ec2]docker-compose run app rails db:create gives an error
- nginx - i can't convert a rails application set up on a docker container on amazon ec2 to ssl
- nginx - [ruby on rails] i want to display the url of an html file placed in a public directory without a file name
- ruby on rails - editing is not reflected locally in docker
- mysql - i want to run an existing rails app in a docker environment
- how to move rails application created with vagrant to docker-compose
- ruby on rails - posts are not reflected on rails
- docker - rails new default file is not generated
- ruby on rails - with ruby on rails, i want to save the video file in the public directory, but an error occurs and i cannot sa
- nginx - cannot display "403 forbidden" web on docker container
- ruby on rails - what is the completion of deploying the rails on docker app to aws?
- ruby on rails - [docker] rails s -b 0000 => cannot render console from 1722801!
- ruby on rails - clone rails on docker to ec2 and do db:create with rds fails
- scss is not reflected creating a rails app
- ruby on rails - about developing with docker
- ruby on rails - scss is not reflected even if compiled in the production environment
- jquery - i want to implement slick with rails, but it is not reflected
- ruby - yarn on docker environment with existing rails 6 application
- nginx : Fail2Ban installed in Host to limit Docker
- mysql - production environment column default value error
- ruby - unable to create table with foreign key
- nginx - detach mode doesn't work with docker run
- mysql - questions about docker errors
- ruby - i want to build a rails environment on docker, but i can't get an error
- mysql - i want to recreate rails db from scratch
- ruby on rails - csrf fails even though authenticity_token is embedded in the parameter
- about api server nginx