I have a react app, which creates a build folder as path /app/admin/build and I want this directory to share as volume to the other nginx container that is running as mentioned in my docker-compose.yaml below. Am I missing anything? I want to share the app build directory to nginx.
However, /var/www/admin/build is getting created when checked login into the container but its empty. Can anyone help with this?
Error: *1 directory index of "/app/admin/build/" is forbidden, client: 172.18.x.x, server: _, request: "GET / HTTP/1.1", host: "localhost"
Thanks in advance
version: '3'
services:
admin:
build:
dockerfile: Dockerfile
context: ./admin
volumes:
- /app/admin/build
web:
restart: always
build:
dockerfile: Dockerfile
context: ./nginx
ports:
- '80:3000'
volumes:
- /app/admin/build:/var/www/admin/build