docker compose v2

This commit is contained in:
Sam
2016-09-29 08:29:34 +02:00
parent 22ea880d1a
commit 9b649269c7
5 changed files with 48 additions and 41 deletions

1
.gitignore vendored
View File

@@ -1 +0,0 @@
data

View File

@@ -2,6 +2,7 @@ DockerFile for invoice ninja (https://www.invoiceninja.com/)
This image is based on `php:7` official version.
The easiest way to try this image is by cloning this repos and run `docker-compose run`.
The easiest way to test Invoice Ninja with docker is by copying the exemple directory and run `docker-compe up`.
The first launch could be slow because we create all tables and seed the database, but once youe see `NOTICE: ready to handle connections` all is ready.
To make your data persistant, you have to mount `/var/www/app/public/logo` and `/var/www/app/storage`.

View File

@@ -1,39 +0,0 @@
db:
image: mysql
environment:
MYSQL_DATABASE: ninja
MYSQL_ROOT_PASSWORD: mdp
app:
image: invoiceninja/invoiceninja
links:
- db:mysql
environment:
APP_DEBUG: 1
web:
image: nginx
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
links:
- app
volumes_from:
- app
ports:
- 80
cron:
image: invoiceninja/invoiceninja
links:
- db:mysql
user: www-data
entrypoint: |
bash -c 'bash -s <<EOF
trap "break;exit" SIGHUP SIGINT SIGTERM
sleep 300s
while /bin/true; do
DB_USERNAME=root DB_PASSWORD=mdp /usr/local/bin/php /var/www/app/artisan ninja:send-invoices
DB_USERNAME=root DB_PASSWORD=mdp /usr/local/bin/php /var/www/app/artisan ninja:send-reminders
sleep 1d
done
EOF'

View File

@@ -0,0 +1,46 @@
version: "2"
services:
db:
image: mysql
environment:
MYSQL_DATABASE: ninja
MYSQL_ROOT_PASSWORD: pwd
app:
image: invoiceninja/invoiceninja
links:
- db:mysql
environment:
APP_DEBUG: 1
DB_USERNAME: root
DB_PASSWORD: pwd
web:
image: nginx
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
links:
- app
volumes_from:
- app
ports:
- 80
cron:
image: invoiceninja/invoiceninja
links:
- db:mysql
user: www-data
environment:
APP_DEBUG: 1
entrypoint: |
bash -c 'bash -s <<EOF
trap "break;exit" SIGHUP SIGINT SIGTERM
sleep 300s
while /bin/true; do
DB_USERNAME=root DB_PASSWORD=pwd /usr/local/bin/php /var/www/app/artisan ninja:send-invoices
DB_USERNAME=root DB_PASSWORD=pwd /usr/local/bin/php /var/www/app/artisan ninja:send-reminders
sleep 1d
done
EOF'