docker-grav
docker-grav copied to clipboard
Bind html to a directory doesn't work
My docker-compose file:
version: '3.3' services: grav: build: ./ container_name: grav ports: - '880:80' restart: always volumes: - '/root/grav/html:/var/www/html' image: 'grav:latest' networks: default: name: test_net
If I run docker-compose up -d, or up --force-recreate --build -d, the html folder is always empty... resulting in a Forbidden error in the browser.
Sadly you can't use bind mounted host dirs because of the docker/mount mechanics:
https://github.com/moby/moby/issues/4361
You really have to use a docker volume as shown in the README.md
@Isotop7 that's really strange. It works with every other container. Why wouldn't that work with grav? Example:
`#NginxProxy
version: '3' services: app: image: 'jc21/nginx-proxy-manager:latest' ports: - '180:80' - '181:81' - '1443:443' environment: DB_MYSQL_HOST: "db" DB_MYSQL_PORT: 3306 DB_MYSQL_USER: "npm" DB_MYSQL_PASSWORD: "npm" DB_MYSQL_NAME: "npm" volumes: - ./data:/data - ./letsencrypt:/etc/letsencrypt db: image: 'jc21/mariadb-aria:latest' environment: MYSQL_ROOT_PASSWORD: 'npm' MYSQL_DATABASE: 'npm' MYSQL_USER: 'npm' MYSQL_PASSWORD: 'npm' volumes: - ./data/mysql:/var/lib/mysql`
`version: '3.3' services: organizr: container_name: organizr volumes: - ./config:/config environment: - PGID=1000 - PUID=1000 - branch=v2-master ports: - '380:80' image: organizr/organizr
networks: default: name: test_net`
Did you find a fix for this? I can build the image but nothing is being created in the volume specified. I have plenty other containers that are using the host file system volume mounts