Compare commits

..

31 Commits
2.8 ... 3.0.5

Author SHA1 Message Date
Sam
0f114b8827 Merge branch 'master' of github.com:invoiceninja/dockerfiles 2017-02-10 16:06:05 +01:00
Sam
bbc3e5303b 3.0.5 2017-02-10 16:05:51 +01:00
Samuel Laulhau
554233c9ea remove phantomjs archive 2017-02-08 17:55:15 +01:00
Sam
7623fceadf 3.0.4 2017-02-08 17:37:58 +01:00
Samuel Laulhau
375f40c710 Merge pull request #43 from freskimo/patch2
removed unused exposed port
2017-02-07 19:05:56 +01:00
Natvingerwerk
4ca9be0a6a removed unused exposed port 2017-02-07 16:03:22 +01:00
Samuel Laulhau
72c23cea15 Merge pull request #40 from freskimo/patch1
Removal .env file use docker env instead
2017-02-07 14:03:47 +01:00
Natvingerwerk
aec8f75414 fix: removed creation of .env file and set this via docker env vars + added doc 2017-02-07 13:02:33 +01:00
Samuel Laulhau
12f011d7ea Merge pull request #38 from cinemast/patch-3
Remove duplicate ENV variables
2017-02-04 11:13:48 +01:00
Peter Spiess-Knafl
1e6c272b04 Remove duplicate ENV variables
Since the variables are passed through an .env file they no longer need to passed directly, right?
2017-02-04 09:00:42 +01:00
Sam
771f647873 make cron work in example 2017-02-03 17:39:33 +01:00
Sam
7ce608aeff add phantomjs 2017-02-02 15:34:19 +01:00
Sam
77098587a3 3.0.3 2017-01-30 15:41:12 +01:00
Sam
706fb0fe2c 3.0.2 2017-01-25 09:04:52 +01:00
Sam
ee1f2f6e09 3.0.1 2017-01-24 18:45:36 +01:00
Sam
27bdd0ec1a 3.0.0 2017-01-24 09:00:36 +01:00
Sam
e53f60dad8 2.9.5 2017-01-14 11:33:39 +01:00
Sam
b0162488bd 2.9.4 2017-01-12 14:52:50 +01:00
Samuel Laulhau
7caf8c9ea8 use same env inside the app then in docker command 2017-01-11 10:09:55 +01:00
Samuel Laulhau
230856e526 Merge pull request #28 from cinemast/patch-1
Enable additional SMTP env variables
2017-01-11 10:03:34 +01:00
Sam
1e2bb5744f 2.9.3 2017-01-04 12:16:52 +01:00
Sam
54004f3038 2.9.2 2017-01-03 13:53:29 +01:00
Peter Spiess-Knafl
9e8717d6d8 Enable additional SMTP env variables 2017-01-02 14:07:58 +01:00
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
6 changed files with 61 additions and 28 deletions

View File

@@ -1,18 +1,26 @@
FROM php:fpm
FROM php:7.0-fpm
MAINTAINER Samuel Laulhau <sam@lalop.co>
#####
# SYSTEM REQUIREMENT
#####
ENV PHANTOMJS phantomjs-2.1.1-linux-x86_64
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
libmcrypt-dev zlib1g-dev git libgmp-dev \
libfreetype6-dev libjpeg62-turbo-dev libpng12-dev \
build-essential chrpath libssl-dev libxft-dev \
libfreetype6 libfontconfig1 libfontconfig1-dev \
&& ln -s /usr/include/x86_64-linux-gnu/gmp.h /usr/local/include/ \
&& docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
&& docker-php-ext-configure gmp \
&& docker-php-ext-install iconv mcrypt mbstring pdo pdo_mysql zip gd gmp \
&& curl -o ${PHANTOMJS}.tar.bz2 -SL https://bitbucket.org/ariya/phantomjs/downloads/${PHANTOMJS}.tar.bz2 \
&& tar xvjf ${PHANTOMJS}.tar.bz2 \
&& rm ${PHANTOMJS}.tar.bz2 \
&& mv ${PHANTOMJS} /usr/local/share \
&& ln -sf /usr/local/share/${PHANTOMJS}/bin/phantomjs /usr/local/bin \
&& rm -rf /var/lib/apt/lists/*
#####
@@ -25,7 +33,7 @@ RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local
# DOWNLOAD AND INSTALL INVOICE NINJA
#####
ENV INVOICENINJA_VERSION 2.8
ENV INVOICENINJA_VERSION 3.0.5
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/ \
@@ -44,11 +52,14 @@ RUN curl -o invoiceninja.tar.gz -SL https://github.com/hillelcoren/invoice-ninja
######
ENV DB_HOST mysql
ENV DB_DATABASE ninja
ENV DB_USERNAME ninja
ENV DB_PASSWORD ninja
ENV APP_KEY SomeRandomString
ENV LOG errorlog
ENV APP_DEBUG 0
ENV APP_CIPHER rijndael-128
ENV SELF_UPDATER_SOURCE ''
ENV PHANTOMJS_BIN_PATH /usr/local/bin/phantomjs
#use to be mounted into nginx for exemple
@@ -56,8 +67,6 @@ VOLUME /var/www/app/public
WORKDIR /var/www/app
EXPOSE 80
COPY app-entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh

View File

@@ -2,7 +2,34 @@ DockerFile for invoice ninja (https://www.invoiceninja.com/)
This image is based on `php:7` official version.
The easiest way to test Invoice Ninja with docker is by copying the example directory and run `docker-compose up`.
The easiest way to test Invoice Ninja with docker is by copying the example directory, run `docker-compose up` and visit http://localhost:8000/ .
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 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
To run it:
```
docker run -d
-e APP_ENV='production'
-e APP_DEBUG=0
-e APP_URL='http://ninja.dev'
-e APP_KEY='SomeRandomStringSomeRandomString'
-e APP_CIPHER='AES-256-CBC'
-e DB_TYPE='mysql'
-e DB_STRICT='false'
-e DB_HOST='localhost'
-e DB_DATABASE='ninja'
-e DB_USERNAME='ninja'
-e DB_PASSWORD='ninja'
-p '80:80'
invoiceninja/invoiceninja
```
A list of environment variables can be found [here](https://github.com/invoiceninja/invoiceninja/blob/master/.env.example)

View File

@@ -1,17 +1,6 @@
#!/bin/bash
set -e
# if we're linked to MySQL, and we're using the root user, and our linked
# container has a default "root" password set up and passed through... :)
: ${DB_USERNAME:=root}
if [ "$DB_USERNAME" = 'root' ]; then
: ${DB_PASSWORD:=$MYSQL_ENV_MYSQL_ROOT_PASSWORD}
fi
echo "DB_USERNAME=$DB_USERNAME" >> .env
echo "DB_PASSWORD=$DB_PASSWORD" >> .env
if [ ! -d /var/www/app/storage ]; then
cp -Rp /var/www/app/docker-backup-storage /var/www/app/storage
else
@@ -34,8 +23,6 @@ else
done
fi
chown www-data:www-data /var/www/app/.env
# 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

13
example/.env Normal file
View File

@@ -0,0 +1,13 @@
APP_DEBUG=1
APP_URL=http://localhost:8000
DB_USERNAME=root
DB_PASSWORD=pwd
DB_HOST=mysql
MAIL_HOST=mail.service.host
MAIL_USERNAME=username
MAIL_PASSWORD=password
MAIL_DRIVER=smtp
MAIL_FROM_NAME="My name"
MAIL_FROM_ADDRESS=user@mail.com

View File

@@ -11,10 +11,7 @@ services:
image: invoiceninja/invoiceninja
links:
- db:mysql
environment:
APP_DEBUG: 1
DB_USERNAME: root
DB_PASSWORD: pwd
env_file: .env
web:
image: nginx
@@ -25,22 +22,22 @@ services:
volumes_from:
- app
ports:
- 80
- 8000:80
cron:
image: invoiceninja/invoiceninja
links:
- db:mysql
user: www-data
environment:
APP_DEBUG: 1
env_file: .env
volumes_from:
- app
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
/usr/local/bin/php /var/www/app/artisan ninja:send-invoices
/usr/local/bin/php /var/www/app/artisan ninja:send-reminders
sleep 1d
done
EOF'