docker-grav icon indicating copy to clipboard operation
docker-grav copied to clipboard

Bind html to a directory doesn't work

Open C-Fu opened this issue 4 years ago • 3 comments
trafficstars

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.

C-Fu avatar Apr 28 '21 20:04 C-Fu

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 avatar May 27 '21 06:05 Isotop7

@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`

C-Fu avatar Jun 05 '21 06:06 C-Fu

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

disgustipated avatar Jan 29 '23 13:01 disgustipated