I know this has probably been asked before, but I am trying to create a docker container for local wordpress development, I have the container up and running with Nginx, mysql, phpmyadmin and wordpress, it all runs, but when I try and access the url, it downloads a file and doesnt open the wordpress installer.
I have the following setup in my default.conf for nginx and it looks right as far as I think it should be,
You have everything in one container? Then you are doing something wrong
If you use multiple frontend services, like WordPress and phpmyadmin, place a reverse proxy in front of them. Check nginx-proxy and Traefik (example), which can do automatic configuration with Docker.
Can you put everything in separate containers then? I was just following a guide that I found as I wanted to learn how to use docker instead of just creating VM on virtualbox, but it just falls at the wordpress setup part despite setting the fastcgi parts up.
Will look into the proxy part. I think that was my next port of call as I had seen that somewhere.
Use Docker compose, create Docker network(s) to connect your containers. Talk to them via service name. WordPress has a Docker image with web server included. Use nginx-proxy or Traefik as reverse proxy for WordPress and phpmyadmin with separate (sub-)domains, only they expose ports.
Weirdly though if I open a browser and go to localhost:8080 it downloads the file, if I browse to localhost:8080/index.php, it works fine and I have a fully working WP development build.