diff --git a/README.md b/README.md index f3efbec..54da63e 100644 --- a/README.md +++ b/README.md @@ -6,8 +6,6 @@ The easiest way to test Invoice Ninja with docker is by copying the example dire To make your data persistent, you have to mount `/var/www/app/public/logo` and `/var/www/app/storage`. -All the supported environment variable can be found here https://github.com/invoiceninja/invoiceninja/blob/master/.env.example - ### Usage @@ -32,6 +30,12 @@ docker run -d A list of environment variables can be found [here](https://github.com/invoiceninja/invoiceninja/blob/master/.env.example) +### With docker-compose + +A pretty ready to use docker-compose configuration can be found into [`./docker-compose`](https://github.com/invoiceninja/dockerfiles/tree/master/docker-compose). +Rename `.env.example` into `.env` and change the environment's variable as needed. +The file assume that all your persistent data is mounted from `/srv/invoiceninja/`. + ### Know issue Phantomjs doesn't work on linux alpine https://github.com/ariya/phantomjs/issues/14186 diff --git a/example/.env b/docker-compose/.env.example similarity index 83% rename from example/.env rename to docker-compose/.env.example index 37a1a5e..1d354e2 100644 --- a/example/.env +++ b/docker-compose/.env.example @@ -1,6 +1,7 @@ +MYSQL_DATABASE=ninja +MYSQL_ROOT_PASSWORD=pwd - -APP_DEBUG=1 +APP_DEBUG=0 APP_URL=http://localhost:8000 APP_KEY=SomeRandomStringSomeRandomString APP_CIPHER=AES-256-CBC diff --git a/docker-compose/docker-compose.yml b/docker-compose/docker-compose.yml new file mode 100644 index 0000000..5b4f40a --- /dev/null +++ b/docker-compose/docker-compose.yml @@ -0,0 +1,49 @@ +version: "2" + +services: + db: + image: mysql + env_file: .env + restart: always + volumes: + - ./srv/invoiceninja/mysql:/var/lib/mysql + + app: + image: invoiceninja/invoiceninja + links: + - db:mysql + env_file: .env + restart: always + volumes: + - ./srv/invoiceninja/storage:/var/www/app/storage:rw + - ./srv/invoiceninja/logo:/var/www/app/public/logo:rw + + web: + image: nginx + volumes: + - ./nginx.conf:/etc/nginx/nginx.conf:ro + links: + - app + volumes_from: + - app + ports: + - 8000:80 + + cron: + image: invoiceninja/invoiceninja + links: + - db:mysql + env_file: .env + volumes_from: + - app + entrypoint: | + bash -c 'bash -s <