wazooinc / local-wordpress-development

A Docker Configuration for Local WordPress development!
7 stars 7 forks source link

Wordpress nginx stutters - Constant restart #3

Open DrunkOne opened 1 month ago

DrunkOne commented 1 month ago

Console report: myapp-nginx | /bin/sh: 1: /start.sh: not found

Could it be related to the Dockerfile found at ./nginx/Dockerfile

Possible bug from Line 6: COPY ./nginx/start.sh / ? (Not a professional)

manuelricci commented 1 month ago

Hi! Are you using Windows? Because I had the same problem and the solution was change the endline character. From CRLF to LF. After change it rebuild with docker-compose build --no-cache and then turn down and up again your container.

DrunkOne commented 1 month ago

Thank you for answering! Yes, I am using Windows, I changed the end-line character on VSCode (bottom right) from CRLF to LF.

Logs from nginx container: `nginx is up and running. You should be able to access

nginx: [emerg] cannot load certificate "/etc/nginx/certs/host.docker.internal.pem": BIO_new_file() failed (SSL: error:80000002:system library::No such file or directory:calling fopen(/etc/nginx/certs/host.docker.internal.pem, r) error:10000080:BIO routines::no such file)`

Do you think I missed a step? I know that it is mentioned in the nginx/default.conf..

//

Anyways, side typic. I tried running a previous version of your repo. From before you added SSL certificate to see if it ran any easier. I keep the simple nginx/default.conf like so:

`server { listen 8080;

root /var/www/html;

location / {
    index index.html;
}

location ~ \.php$ {
    try_files $uri =404;
    fastcgi_split_path_info ^(.+\.php)(/.+)$;
    fastcgi_pass wordpress:9000;
    fastcgi_index index.php;
    include fastcgi_params;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    fastcgi_param PATH_INFO $fastcgi_path_info;
}

}`

The containers fully start up, seems to be working. But clicking port 8080 it simply downloads a file "download.php" It seems not to be indexing back to Wordpress, not sure if you've ran into this issue before?

manuelricci commented 1 month ago

Good! A different error is sign of progression 🥳

Just to clarify, I'm not the mainteiner of the repo, I'm just a random guy who found the tutorial on YouTube and do some tweaks by his own.

I wrote to the owner of the repo if I can do some pull request to fix some bugs and I'm waiting for his reply.

Btw, to better address your problem can you share your dockerfile and docker-compose.yml? My guess is there's something wrong with the build of the nginx container, but I need a little more details.

DrunkOne commented 1 month ago

All is good haha, I am simply a random guy myself who is trying to learn how to deploy stuff using Docker and my target is WordPress =)

Here's the repo, I am trying to build a repo of the same code without the cert. https://github.com/DrunkOne/docker-wordpress