Just to start off, I have seen this. But he/she uses build
, and I use image
.
I have a docker-compose file that pulls an image that I have made previously onto my server.
app:
restart: always
image: some-app-image:latest
nginx config
location /static/ {
root /data/app/web_interface; <--- this exists in some-app-image container
}
Normally, I would have a volume mounted onto the app image that contains the static files.
However, this is becoming redundant since the app container has the static files in itself.
All the nginx container needs to do is "peer" into the app container and serve those static files. Like:
location /static/ {
root http://app:8000/web_interface;
}
or
location /static/ {
root app/web_interface;
}
Any chance there is a way to serve static files located in another container from a nginx container?