I'm trying to dockerize a rails app and nginx with 2 separate containers. The rails app uses Unicorn and listens on a socket with static files serving from a folder. Now I need so somehow share the .sock and a folder to the NGINX container. This is how I ran 2 containers:
docker run -d --name app app:latest
docker run -d --name nginx -v /src/sockets:/src/sockets -v /src/public:/src/public --link app -p 80:80 nginx:latest
So expectedly, a .sock
should be seen from /src/sockets
inside Nginx container, but it becomes a folder instead, ie /src/sockets/app.sock/
, and the static folder is empty.
Now these containers will be ran on AWS ECS, which is why I didn't use Docker-compose or share the volumes to host. I'm trying to mimic how ECS would work via Task Definition.