Compare commits

..

16 Commits
2.7.2 ... 2.9.1

Author SHA1 Message Date
Sam
5ba03e8ccf 2.9.1 2016-12-20 18:31:51 +01:00
Samuel Laulhau
dd9fea1a33 Merge pull request #25 from cinemast/master
Use php7.0 instead of latest. (Closes #23)
2016-12-19 09:49:18 +01:00
Samuel Laulhau
4f79c894e6 2.9.0 2016-12-15 17:42:49 +01:00
Samuel Laulhau
5820915a50 2.9 2016-12-15 17:19:29 +01:00
Peter Spiess-Knafl
7c1a352676 Use php7.0 instead of latest. (Closes #23) 2016-12-09 13:40:07 +01:00
Samuel Laulhau
ce2dd38f9d 2.8.2 2016-11-30 10:33:00 +01:00
Samuel Laulhau
6c67e98f79 2.8.1 2016-11-18 09:57:56 +01:00
Sam
72ee5ef29e rename exemple folder #22 2016-11-07 21:07:59 +01:00
Samuel Laulhau
e81f46b9e0 2.8 2016-11-07 09:39:36 +01:00
Samuel Laulhau
bbf20d1390 typo 2016-10-12 11:16:26 -04:00
Samuel Laulhau
12a6120734 avoid seed temp fix for twice seeding 2016-10-05 15:55:47 +02:00
Samuel Laulhau
2b1923ea7f avoid seed temp fix for twice seeding 2016-10-05 12:51:50 +02:00
Sam
5c9495cabd typo 2016-09-29 08:34:00 +02:00
Sam
9b649269c7 docker compose v2 2016-09-29 08:29:34 +02:00
Sam
22ea880d1a seed only once 2016-09-29 08:07:07 +02:00
Sam
a1037c8459 add migration to entrypoint 2016-09-29 07:51:33 +02:00
7 changed files with 82 additions and 47 deletions

1
.gitignore vendored
View File

@@ -1 +0,0 @@
data

View File

@@ -1,4 +1,4 @@
FROM php:fpm
FROM php:7.0-fpm
MAINTAINER Samuel Laulhau <sam@lalop.co>
@@ -25,7 +25,7 @@ RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local
# DOWNLOAD AND INSTALL INVOICE NINJA
#####
ENV INVOICENINJA_VERSION 2.7.2
ENV INVOICENINJA_VERSION 2.9.1
RUN curl -o invoiceninja.tar.gz -SL https://github.com/hillelcoren/invoice-ninja/archive/v${INVOICENINJA_VERSION}.tar.gz \
&& tar -xzf invoiceninja.tar.gz -C /var/www/ \
@@ -34,6 +34,7 @@ RUN curl -o invoiceninja.tar.gz -SL https://github.com/hillelcoren/invoice-ninja
&& chown -R www-data:www-data /var/www/app \
&& composer install --working-dir /var/www/app -o --no-dev --no-interaction --no-progress \
&& chown -R www-data:www-data /var/www/app/bootstrap/cache \
# && echo ${INVOICENINJA_VERSION} > /var/www/app/storage/version.txt \
&& mv /var/www/app/storage /var/www/app/docker-backup-storage \
&& mv /var/www/app/public/logo /var/www/app/docker-backup-public-logo

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 example directory and run `docker-compose 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`.
To make your data persistent, you have to mount `/var/www/app/public/logo` and `/var/www/app/storage`.

View File

@@ -35,8 +35,35 @@ else
fi
chown www-data:www-data /var/www/app/.env
# php artisan optimize --force
# php artisan migrate --force
# php artisan db:seed --class=UpdateSeeder
# widely inspired from https://github.com/docker-library/wordpress/blob/c674e9ceedf582705e0ad8487c16b42b37a5e9da/fpm/docker-entrypoint.sh#L128
TERM=dumb php -- "$DB_HOST" "$DB_USERNAME" "$DB_PASSWORD" "$DB_DATABASE" <<'EOPHP'
<?php
$stderr = fopen('php://stderr', 'w');
list($host, $port) = explode(':', $argv[1], 2);
$maxTries = 20;
do {
try {
$connection = new Pdo("mysql:dbname={$argv[4]};host={$host};port={$port}", $argv[2], $argv[3]);
fwrite($stderr, 'MySQL ready'. "\n");
exit(0);
} catch (PDOException $e) {
fwrite($stderr, 'MySQL Connection Error: ' . $e->getMessage(). "\n");
if (--$maxTries <= 0) {
exit(1);
}
sleep(3);
}
} while (true);
EOPHP
#php artisan optimize --force
#php artisan migrate --force
#if [ ! -e "/var/www/app/is-seeded" ]; then
#php artisan db:seed --force
#touch "/var/www/app/is-seeded"
#fi
echo 'start'
exec "$@"

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 30s
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'