getgrav / docker-grav

Official Docker Image for Grav
https://getgrav.org
197 stars 123 forks source link

Docker-grav with proxy #4

Open SnuppeDeluxe opened 5 years ago

SnuppeDeluxe commented 5 years ago

Hi, I tried your container in a standalone machine. It worked great and I wont to use it in production. But my production system is behind a proxy (https://github.com/evertramos/docker-compose-letsencrypt-nginx-proxy-companion) and every system is managed by this proxy. Now I tried to generate a docker-compose file, to use your image with the proxy, but I don't have any rights for the connection.

Forbidden You don't have permission to access / on this server. Apache/2.4.25 (Debian) Server at *****myURL**** Port 80

Please, help me. Where is my mistake?


version: '3'

services: grav: image: 'grav:latest' volumes:

networks: default: external: name: webproxy

boTux commented 5 years ago

Hi,

It's because you used a volume for /var/www/html in your docker-compose.yml

volumes:
  - ./data:/var/www/html

And for now if you bind a volume you have to install grav manually inside your container.

Checkout #5 where I'm trying to solve this.

Thanks,

holdenrehg commented 5 years ago

+1 to merge @boTux

Worked well for me, was able to mount a volume via docker-compose.yml properly. Without having the mount override the directory after the container starts up.

SimJoSt commented 5 years ago

Most of the time you will only need the user, backup and logs directories outside of your container. I recommend volumes for those three instead of the whole system.

gushmazuko commented 3 years ago

You can use Traefik instead of NGINX proxy. It's more perfulll, simple and nativerly supported by docker.