fix docker-compose setup configurations

This commit is contained in:
Tristan Guo 2017-02-05 18:49:06 +08:00
parent 19b4fb6a2f
commit 1ac0dbcff7
4 changed files with 70 additions and 48 deletions

View File

@ -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

View File

@ -1,4 +1,4 @@
FROM php:fpm
FROM php:7.0-fpm
RUN apt-get update && apt-get install -y \
libpq-dev \
libmcrypt-dev \

View File

@ -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

View File

@ -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`