what I have:
- 1 running nginx proxy container by jwilder using the
- several containers for several domains with databases and wordpress instances
what I need:
run a small php application on a subdomain
I am new to docker, nginx etc so this question might seem a little stupid to you but after hours of research I could not find anything that actually answers my fundamental questions:
–> How can I host a simple php file with a new docker container making use of the existing nginx proxy container and without changing the nginx container.
My docker-compose so far:
version: '2' services: unternehmenswertrechner: image: php:fpm ports: - "9090:80" environment: - VIRTUAL_HOST=subdomain.xxx.tld - VIRTUAL_PROTO=fastcgi - VIRTUAL_PORT=9090 - VIRTUAL_ROOT=/var/www/html - VIRTUAL_NETWORK=nginx-proxy - LETSENCRYPT_HOST=subdomain.xxx.tld - LETSENCRYPT_EMAIL=xxx volumes: - /srv/www/production/subdomain.xxx.tld:/var/www/html
So my questions are:
- Do I have to name the ports? 9090 seemed to be free
- inside the
/srv/www/production/subdomain.xxx.tldlies a simple index.php file. Do I have to call it or does calling the
/url already call the index.php?
- what image should I use?
- Is making use of the
VIRTUAL_HOSTvariable enough to actually create a working subdomain? Of course I have registered a CNAME inside my providers dns settings.
There is no error the container is not really starting this way so I guess the
docker-compose.yml is not yet correct
Source: Docker Questions