From 1ac0dbcff7c46fa2019ebad5345c77308c1a9237 Mon Sep 17 00:00:00 2001 From: Tristan Guo Date: Sun, 5 Feb 2017 18:49:06 +0800 Subject: [PATCH] fix docker-compose setup configurations --- .env.example | 2 +- Dockerfile-php | 2 +- docker-compose.yml | 108 +++++++++++++++++++++++++++------------------ readme.md | 6 +-- 4 files changed, 70 insertions(+), 48 deletions(-) diff --git a/.env.example b/.env.example index 4cdfe3e7..05ac711f 100644 --- a/.env.example +++ b/.env.example @@ -5,7 +5,7 @@ APP_CIPHER=AES-256-CBC APP_KEY= APP_TIMEZONE= -DB_TYPE=mysql +DB_TYPE=pgsql DB_HOST=db DB_DATABASE=attendize DB_USERNAME=attendize diff --git a/Dockerfile-php b/Dockerfile-php index 694d53f6..8b7d0e7b 100644 --- a/Dockerfile-php +++ b/Dockerfile-php @@ -1,4 +1,4 @@ -FROM php:fpm +FROM php:7.0-fpm RUN apt-get update && apt-get install -y \ libpq-dev \ libmcrypt-dev \ diff --git a/docker-compose.yml b/docker-compose.yml index 0efe2923..ae633d85 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,44 +1,66 @@ -web: - build: . - dockerfile: Dockerfile-nginx - ports: +version: '2' + +services: + web: + build: + context: . + dockerfile: Dockerfile-nginx + ports: - "8080:80" - links: - - php - volumes: - - .:/usr/share/nginx/html/attendize -php: - build: . - dockerfile: Dockerfile-php - links: - - db - - maildev - - redis - volumes: - - .:/usr/share/nginx/html/attendize -php-worker: - build: . - dockerfile: Dockerfile-php - links: - - db - - maildev - - redis - volumes: - - .:/usr/share/nginx/html/attendize - command: php artisan queue:work --daemon -db: - image: postgres - environment: - - POSTGRES_USER=attendize - - POSTGRES_PASSWORD=attendize - - POSTGRES_DB=attendize - ports: - - "5433:5432" - volumes: - - ./docker/pgdata:/var/lib/postgresql/data -maildev: - image: djfarrelly/maildev - ports: - - "1080:80" -redis: - image: redis + networks: + - attendizenet + volumes: + - .:/usr/share/nginx/html/attendize + depends_on: + - php + php: + build: + context: . + dockerfile: Dockerfile-php + depends_on: + - db + - maildev + - redis + volumes: + - .:/usr/share/nginx/html/attendize + networks: + - attendizenet + php-worker: + build: + context: . + dockerfile: Dockerfile-php + depends_on: + - db + - maildev + - redis + volumes: + - .:/usr/share/nginx/html/attendize + command: php artisan queue:work --daemon + networks: + - attendizenet + db: + image: postgres + environment: + - POSTGRES_USER=attendize + - POSTGRES_PASSWORD=attendize + - POSTGRES_DB=attendize + ports: + - "5433:5432" + volumes: + - ./docker/pgdata:/var/lib/postgresql/data + networks: + - attendizenet + maildev: + image: djfarrelly/maildev + ports: + - "1080:80" + networks: + - attendizenet + redis: + image: redis + networks: + - attendizenet + +networks: + attendizenet: + driver: bridge diff --git a/readme.md b/readme.md index ca97139a..b1bbedc4 100644 --- a/readme.md +++ b/readme.md @@ -72,12 +72,12 @@ To run a docker dev entionment do the following: git clone https://github.com/Attendize/Attendize cd Attendize cp .env.example .env +chmod -R a+w storage +chmod -R a+w public/user_content docker-compose build docker run --rm -v $(pwd):/app composer/composer install -docker-compose up +docker-compose up -d docker-compose run php php artisan attendize:install -chmod a+w -R storage -chmod a+w -R public/user_content ``` Attendize will be available at `http://localhost:8080` and maildev at `http://localhost:1080`