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

Docker Image for Grav based on NGINX

Open gushmazuko opened this issue 4 years ago • 4 comments

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

gushmazuko avatar Dec 14 '20 13:12 gushmazuko

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

KaiDevrim avatar Oct 04 '21 07:10 KaiDevrim

@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 avatar Oct 06 '21 00:10 dudeitssm

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!

dudeitssm avatar Oct 16 '21 18:10 dudeitssm

hello, @rhukster what do you think about?

gushmazuko avatar Jul 27 '22 15:07 gushmazuko