symfony-docker
symfony-docker copied to clipboard
Update installation/usage instructions - or am I doing something wrong?
git clone https://github.com/drgomesp/symfony-docker
cd symfony-docker
# README says we need jwilder/nginx-proxy so...
docker run -d -p 80:80 -v /var/run/docker.sock:/tmp/docker.sock:ro jwilder/nginx-proxy
docker-compose up -d --build
At this point I realise that composer install hasn't been run so:
docker-compose run symfony-docker composer --prefer-source install
Going to http://localhost/ gives me 503 Service Temporarily Unavailable.
Going to http://localhost:81/ gives me Unable to create the cache directory (/app/var/cache/dev)
Following the instructions at the link in the README also fails in a similar way:
http://drgomesp.github.io/symfony-docker/
Installing using composer:
composer create-project drgomesp/symfony-docker
cd symfony-docker
docker-compose up -d
Am I doing something wrong? Or is the readme outdated?
Going to http://localhost:81/ gives me Unable to create the cache directory (/app/var/cache/dev)
Your php-fpm instance is not allowed to write into the project. Check the permissions and the owner of the project files and folders.
For the nginx proxy, please read the documentation: https://github.com/jwilder/nginx-proxy
There's a short snippet for docker compose. If you add the relating lines to the docker-compose.yml you should reach the symfony project. Please bear in mind that you need to add the domain name to your host-file.
An example:
docker-compose.yml
version: '2'
services:
nginx-proxy:
image: jwilder/nginx-proxy
ports:
- "80:80"
volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro
app:
container_name: sf.app
build: docker/php
volumes:
- .:/app
- ./var/logs:/app/var/logs
- ./var/cache.:/app/var/cache
nginx:
container_name: sf.nginx
build: docker/nginx
volumes_from:
- app
ports:
- "81:80"
environment:
- VIRTUAL_HOST=symfony-docker.dev
entry in /etc/hosts
[...]
127.0.0.1 symfony-docker.dev localhost
[...]
.docker/nginx/sites-enabled/vhost_dev.conf
[...]
server_name symfony-docker.dev;
[...]
After you've set the config files correctly, run docker-compose up -d --build and you should reach the symfony project at symfony-docker.dev on your local machine.