getgrav / docker-grav

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

Docker Image for Grav based on NGINX #34

Open gushmazuko opened 3 years ago

gushmazuko commented 3 years ago

Hello, there is Dockerfile image based NGINX instead APACHE used currently. The image was made following the official documentation: https://learn.getgrav.org/17/webservers-hosting/vps/digitalocean

My repository: https://github.com/gushmazuko/grav-nginx Docker Hub: https://hub.docker.com/r/gushmazuko/grav-nginx

KaiDevrim commented 3 years ago

i get an error 403 when running this container and accessing it from another computer on the same lan

dudeitssm commented 3 years ago

@KaiDevrim which steps did you take? These are exactly the commands I used to get it running on port 9000.

Commands to get this docker image running:

$ git clone https://github.com/gushmazuko/docker-grav
$ cd docker-grav/grav-nginx/
$ podman build -t grav-nginx .
$ podman run -d -p 9000:80 --restart always -v grav_data:/usr/share/nginx/html localhost/grav-nginx

Once complete, I opened the firewalld port 9000/tcp using sudo firewall-cmd --permanent --add-port=9000/tcp and sudo firewall-cmd --reload.

Screenshot_2021-10-05_20-19-09

Note that after the initial configuration, the URL redirects to http://<URL>/admin/ instead of http://<URL>:<PORT>/admin/, which is normal, because you're typically supposed to run this behind a proxy-pass.

By the way, this nginx based image is roughly half the image size of the regular, apache based docker image! So good work @gushmazuko! Thumbs up and I hope the grav maintainer considers it!


Thoughts after deploying to prod...It's not quite ready.

(EDIT: I've found a fix: simply delete the file located within the container /usr/share/nginx/html/index.html and the bug mentioned below is gone!)

After I deployed to "prod", under load, the nginx service within the container will randomly bug out such that the home page redirects to the default nginx splash. However, any other pages under the domain are unaffected. I will see if I can find any helpful logs by sifting through the access and error logs.

image image

@gushmazuko ^^

dudeitssm commented 3 years ago

I have opened a PR to fix this on @gushmazuko 's repo, by editing the Dockerfile https://github.com/gushmazuko/grav-nginx/pull/1

Cheers for this image!

gushmazuko commented 2 years ago

hello, @rhukster what do you think about?