mirror of
https://github.com/invoiceninja/dockerfiles.git
synced 2026-01-09 07:57:26 +01:00
Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8be256b789 | ||
|
|
3424f257f5 | ||
|
|
533905e678 | ||
|
|
c6bca0dba5 | ||
|
|
bd5168562f | ||
|
|
912692b267 | ||
|
|
2405269fdc |
31
Dockerfile
31
Dockerfile
@@ -5,7 +5,8 @@ FROM php:fpm
|
|||||||
#####
|
#####
|
||||||
RUN apt-get update \
|
RUN apt-get update \
|
||||||
&& apt-get install -y libmcrypt-dev zlib1g-dev git\
|
&& apt-get install -y libmcrypt-dev zlib1g-dev git\
|
||||||
&& docker-php-ext-install iconv mcrypt mbstring pdo pdo_mysql zip
|
&& docker-php-ext-install iconv mcrypt mbstring pdo pdo_mysql zip \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
#####
|
#####
|
||||||
# INSTALL COMPOSER
|
# INSTALL COMPOSER
|
||||||
@@ -17,37 +18,37 @@ RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local
|
|||||||
# DOWNLOAD AND INSTALL INVOICE NONJA
|
# DOWNLOAD AND INSTALL INVOICE NONJA
|
||||||
#####
|
#####
|
||||||
|
|
||||||
WORKDIR /var/www/
|
ENV INVOICENINJA_VERSION 2.4.4
|
||||||
|
|
||||||
ENV INVOICENINJA_VERSION 2.4.3
|
|
||||||
#ENV INVOICENINJA_SHA1 3e9b63c1681b6923dc1a24399411c1abde6ef5ea
|
#ENV INVOICENINJA_SHA1 3e9b63c1681b6923dc1a24399411c1abde6ef5ea
|
||||||
|
|
||||||
RUN curl -o invoiceninja.tar.gz -SL https://github.com/hillelcoren/invoice-ninja/archive/v${INVOICENINJA_VERSION}.tar.gz \
|
RUN curl -o invoiceninja.tar.gz -SL https://github.com/hillelcoren/invoice-ninja/archive/v${INVOICENINJA_VERSION}.tar.gz \
|
||||||
# && echo "$INVOICENINJA_SHA1 *invoiceninja.tar.gz" | sha1sum -c - \
|
# && echo "$INVOICENINJA_SHA1 *invoiceninja.tar.gz" | sha1sum -c - \
|
||||||
&& tar -xzf invoiceninja.tar.gz \
|
&& tar -xzf invoiceninja.tar.gz -C /var/www/ \
|
||||||
&& mv invoice-ninja-${INVOICENINJA_VERSION} app \
|
&& rm invoiceninja.tar.gz \
|
||||||
&& rm -rf html \
|
&& mv /var/www/invoiceninja-${INVOICENINJA_VERSION} /var/www/app \
|
||||||
&& ln -s app/public html \
|
&& chown -R www-data:www-data /var/www/app \
|
||||||
&& rm invoiceninja.tar.gz \
|
&& composer install --working-dir /var/www/app -o --no-dev --no-interaction
|
||||||
# && chown -R www-data:www-data /var/www/ \
|
|
||||||
&& composer install --working-dir app -o
|
|
||||||
|
|
||||||
|
|
||||||
######
|
######
|
||||||
# DEFAULT ENV
|
# DEFAULT ENV
|
||||||
######
|
######
|
||||||
ENV DB_HOST mysql
|
ENV DB_HOST mysql
|
||||||
|
ENV DB_DATABASE ninja
|
||||||
ENV APP_KEY SomeRandomString
|
ENV APP_KEY SomeRandomString
|
||||||
ENV LOG errorlog
|
ENV LOG errorlog
|
||||||
ENV APP_DEBUG 0
|
ENV APP_DEBUG 0
|
||||||
|
|
||||||
|
|
||||||
#use to be mounted into nginx for exemple
|
#use to be mounted into nginx for exemple
|
||||||
VOLUME /var/www/html
|
VOLUME /var/www/app/public
|
||||||
|
|
||||||
VOLUME /var/www/app/storage
|
WORKDIR /var/www/app
|
||||||
VOLUME /var/www/app/public/logo
|
|
||||||
|
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
|
|
||||||
|
COPY app-entrypoint.sh /entrypoint.sh
|
||||||
|
RUN chmod +x /entrypoint.sh
|
||||||
|
|
||||||
|
ENTRYPOINT ["/entrypoint.sh"]
|
||||||
CMD ["php-fpm"]
|
CMD ["php-fpm"]
|
||||||
|
|||||||
@@ -1 +1,3 @@
|
|||||||
DockerFile for invoice ninja (https://www.invoiceninja.com/)
|
DockerFile for invoice ninja (https://www.invoiceninja.com/)
|
||||||
|
|
||||||
|
To test Invoice Ninja you can copy docker-compose.yml, remove the volume linked which can cause some troubles if you use docker on Mac, and run it.
|
||||||
|
|||||||
17
app-entrypoint.sh
Normal file
17
app-entrypoint.sh
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
#!/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
|
||||||
|
|
||||||
|
chown www-data .env
|
||||||
|
|
||||||
|
exec "$@"
|
||||||
@@ -2,24 +2,12 @@ db:
|
|||||||
image: mysql
|
image: mysql
|
||||||
environment:
|
environment:
|
||||||
MYSQL_DATABASE: ninja
|
MYSQL_DATABASE: ninja
|
||||||
MYSQL_USER: user
|
|
||||||
MYSQL_PASSWORD: pass
|
|
||||||
MYSQL_ROOT_PASSWORD: mdp
|
MYSQL_ROOT_PASSWORD: mdp
|
||||||
|
|
||||||
app:
|
app:
|
||||||
image: invoice-ninja
|
image: lalop/invoice-ninja:2.4.4
|
||||||
links:
|
links:
|
||||||
- db:mysql
|
- db:mysql
|
||||||
environment:
|
|
||||||
- APP_DEBUG=true
|
|
||||||
- APP_KEY=invoicekeyinvoicekeyinvoicekey12
|
|
||||||
- DB_USERNAME=user
|
|
||||||
- DB_PASSWORD=pass
|
|
||||||
- DB_DATABASE=ninja
|
|
||||||
- DB_HOST=mysql
|
|
||||||
volumes:
|
|
||||||
- ./data/storage:/var/www/app/storage:rw
|
|
||||||
- ./data/logo:/var/www/app/public/logo:rw
|
|
||||||
|
|
||||||
web:
|
web:
|
||||||
image: nginx
|
image: nginx
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ http {
|
|||||||
listen 80 default;
|
listen 80 default;
|
||||||
server_name your_ininja_site;
|
server_name your_ininja_site;
|
||||||
|
|
||||||
root /var/www/html;
|
root /var/www/app/public;
|
||||||
|
|
||||||
index index.php;
|
index index.php;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user