Skip to content
This repository has been archived by the owner on Apr 25, 2022. It is now read-only.

Update installation/usage instructions - or am I doing something wrong? #37

Open
LeighBicknell opened this issue Aug 8, 2017 · 1 comment

Comments

@LeighBicknell
Copy link

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?

@dj95
Copy link

dj95 commented Dec 14, 2017

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.

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

No branches or pull requests

2 participants