Pointing nginx container to static files in docker
I think what you want to achieve should be done by mounting a volume of container 'api' to container 'nginx', something like this:
version: "3"services: api: image: apiimg volumes: - apivol:/path/to/statics nginx: image: nginximg volumes: - apivol:/var/www/staticsvolumes: apivol: {}
So there's a shared volume declared for all containers, apivol
, which is mapped to /path/to/statics
on your Rails container, and to /var/www/statics
in your nginx container. This way you don't need to copy anything manually into the nginx container.