Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker Image for Grav based on NGINX #34

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

gushmazuko
Copy link

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
Copy link

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

@dudeitssm
Copy link

dudeitssm commented Oct 6, 2021

@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
Copy link

I have opened a PR to fix this on @gushmazuko 's repo, by editing the Dockerfile gushmazuko/grav-nginx#1

Cheers for this image!

@gushmazuko
Copy link
Author

hello, @rhukster what do you think about?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants