mirror of
https://github.com/invoiceninja/dockerfiles.git
synced 2026-01-28 01:37:12 +01:00
Compare commits
45 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9377777f62 | ||
|
|
ac7c520620 | ||
|
|
1ae79cde4f | ||
|
|
a58b89c55d | ||
|
|
89e6cffa90 | ||
|
|
a82d60b4f5 | ||
|
|
32c93eb4d7 | ||
|
|
9e603ba79f | ||
|
|
d9889fcfaa | ||
|
|
a89e145bf9 | ||
|
|
85d46e8968 | ||
|
|
0fb5fa73e0 | ||
|
|
de3a2e4278 | ||
|
|
bb514e8d06 | ||
|
|
2034c6ebff | ||
|
|
65e36505a3 | ||
|
|
03c1e32123 | ||
|
|
3612c87323 | ||
|
|
4e9731a23e | ||
|
|
dea442c442 | ||
|
|
a24c1b98a3 | ||
|
|
1596478724 | ||
|
|
a240fd2977 | ||
|
|
7c1ef67755 | ||
|
|
bfc1d7add8 | ||
|
|
111f5a7e4e | ||
|
|
330f3e1c0e | ||
|
|
baeb925d87 | ||
|
|
079a05bbd8 | ||
|
|
8e995aa2ef | ||
|
|
dee4d0f27d | ||
|
|
60e5a68e01 | ||
|
|
67ad43d05d | ||
|
|
35beefba60 | ||
|
|
d1309cc86f | ||
|
|
a1d9220506 | ||
|
|
386359a346 | ||
|
|
b503418904 | ||
|
|
450eaf16e3 | ||
|
|
1f65c9f7f6 | ||
|
|
c02bf7bd03 | ||
|
|
4111fa87c9 | ||
|
|
0d5a7671ba | ||
|
|
7ea6e7c48e | ||
|
|
27e1788e91 |
@@ -1,4 +1,4 @@
|
|||||||
ARG PHP_VERSION=7.3
|
ARG PHP_VERSION=7.4
|
||||||
|
|
||||||
# Get Invoice Ninja
|
# Get Invoice Ninja
|
||||||
FROM alpine:latest as base
|
FROM alpine:latest as base
|
||||||
@@ -8,7 +8,6 @@ RUN set -eux; \
|
|||||||
apk add --no-cache \
|
apk add --no-cache \
|
||||||
curl \
|
curl \
|
||||||
mysql-client \
|
mysql-client \
|
||||||
git \
|
|
||||||
libarchive-tools; \
|
libarchive-tools; \
|
||||||
mkdir -p /var/www/app
|
mkdir -p /var/www/app
|
||||||
|
|
||||||
@@ -19,7 +18,6 @@ RUN curl -o /tmp/ninja.tar.gz -LJ0 https://github.com/invoiceninja/invoiceninja/
|
|||||||
&& cp -R /var/www/app/public /var/www/app/docker-backup-public \
|
&& cp -R /var/www/app/public /var/www/app/docker-backup-public \
|
||||||
&& mkdir -p /var/www/app/public/logo /var/www/app/storage \
|
&& mkdir -p /var/www/app/public/logo /var/www/app/storage \
|
||||||
&& cp /var/www/app/.env.example /var/www/app/.env \
|
&& cp /var/www/app/.env.example /var/www/app/.env \
|
||||||
&& cp /var/www/app/.env.dusk.example /var/www/app/.env.dusk.local \
|
|
||||||
&& rm -rf /var/www/app/docs /var/www/app/tests
|
&& rm -rf /var/www/app/docs /var/www/app/tests
|
||||||
|
|
||||||
# Install nodejs packages
|
# Install nodejs packages
|
||||||
@@ -52,15 +50,18 @@ RUN set -eux; \
|
|||||||
gmp-dev \
|
gmp-dev \
|
||||||
libjpeg-turbo-dev \
|
libjpeg-turbo-dev \
|
||||||
libpng-dev \
|
libpng-dev \
|
||||||
libzip-dev; \
|
libzip-dev \
|
||||||
docker-php-ext-configure zip --with-libzip; \
|
oniguruma-dev \
|
||||||
docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ --with-png-dir=/usr/include/; \
|
git \
|
||||||
|
busybox-suid \
|
||||||
|
zip; \
|
||||||
|
docker-php-ext-configure gd --with-freetype --with-jpeg; \
|
||||||
docker-php-ext-install -j$(nproc) \
|
docker-php-ext-install -j$(nproc) \
|
||||||
bcmath \
|
bcmath \
|
||||||
exif \
|
exif \
|
||||||
gd \
|
gd \
|
||||||
gmp \
|
gmp \
|
||||||
mbstring \
|
# mbstring \
|
||||||
mysqli \
|
mysqli \
|
||||||
opcache \
|
opcache \
|
||||||
pdo \
|
pdo \
|
||||||
@@ -81,18 +82,11 @@ RUN apk add --no-cache \
|
|||||||
nodejs \
|
nodejs \
|
||||||
yarn
|
yarn
|
||||||
|
|
||||||
# Tell Puppeteer to skip installing Chrome. We'll be using the installed package.
|
|
||||||
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true \
|
|
||||||
PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium-browser
|
|
||||||
|
|
||||||
# Puppeteer v1.19.0 works with Chromium 77.
|
|
||||||
RUN yarn add puppeteer@1.19.0
|
|
||||||
|
|
||||||
## Separate user
|
## Separate user
|
||||||
ENV INVOICENINJA_USER=invoiceninja
|
ENV INVOICENINJA_USER=invoiceninja
|
||||||
|
|
||||||
RUN addgroup -S "$INVOICENINJA_USER" && \
|
RUN addgroup --gid=1500 -S "$INVOICENINJA_USER" && \
|
||||||
adduser \
|
adduser --uid=1500 \
|
||||||
--disabled-password \
|
--disabled-password \
|
||||||
--gecos "" \
|
--gecos "" \
|
||||||
--home "$(pwd)" \
|
--home "$(pwd)" \
|
||||||
@@ -102,24 +96,18 @@ RUN addgroup -S "$INVOICENINJA_USER" && \
|
|||||||
addgroup "$INVOICENINJA_USER" www-data; \
|
addgroup "$INVOICENINJA_USER" www-data; \
|
||||||
chown -R "$INVOICENINJA_USER":"$INVOICENINJA_USER" /var/www/app
|
chown -R "$INVOICENINJA_USER":"$INVOICENINJA_USER" /var/www/app
|
||||||
|
|
||||||
|
|
||||||
# Install Composer
|
# Install Composer
|
||||||
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer;
|
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer;
|
||||||
|
|
||||||
## Set up the cronjob and run cron daemon
|
|
||||||
RUN echo "* * * * * run-parts /etc/periodic/1min" >> /etc/crontabs/root
|
|
||||||
COPY ./config/cron/cronjob_v5.sh /etc/periodic/1min/invoiceninja_cronjob
|
|
||||||
RUN chown $INVOICENINJA_USER /etc/periodic/1min/invoiceninja_cronjob && \
|
|
||||||
crond -l 2 -b
|
|
||||||
|
|
||||||
USER $INVOICENINJA_USER
|
USER $INVOICENINJA_USER
|
||||||
|
|
||||||
RUN /usr/local/bin/composer install --no-dev
|
RUN /usr/local/bin/composer install --no-dev --no-suggest --no-progress --quiet
|
||||||
|
|
||||||
# Override the environment settings from projects .env file
|
# Override the environment settings from projects .env file
|
||||||
ENV APP_ENV production
|
ENV APP_ENV production
|
||||||
ENV LOG errorlog
|
ENV LOG errorlog
|
||||||
|
ENV SNAPPDF_EXECUTABLE_PATH /usr/bin/chromium-browser
|
||||||
RUN php artisan storage:link
|
|
||||||
|
|
||||||
ENTRYPOINT ["docker-entrypoint"]
|
ENTRYPOINT ["docker-entrypoint"]
|
||||||
CMD ["php-fpm"]
|
CMD ["php-fpm"]
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
server {
|
server {
|
||||||
listen 80 default_server;
|
listen 80 default_server;
|
||||||
server_name in.localhost;
|
server_name _ in.localhost;
|
||||||
|
|
||||||
root /var/www/app/public/;
|
root /var/www/app/public/;
|
||||||
index index.php;
|
index index.php;
|
||||||
|
|||||||
@@ -2,52 +2,40 @@ version: '3.7'
|
|||||||
|
|
||||||
services:
|
services:
|
||||||
server:
|
server:
|
||||||
image: caddy:alpine
|
image: nginx
|
||||||
restart: always
|
restart: always
|
||||||
environment:
|
environment:
|
||||||
- APP_URL=https://localhost
|
- APP_URL=http://in.localhost:8003
|
||||||
volumes:
|
volumes:
|
||||||
# Vhost configuration
|
# Vhost configuration
|
||||||
- ./config/caddy/Caddyfile:/etc/caddy/Caddyfile
|
#- ./config/caddy/Caddyfile:/etc/caddy/Caddyfiledocker-com
|
||||||
|
- ./config/nginx/in-vhost.conf:/etc/nginx/conf.d/in-vhost.conf:ro
|
||||||
# Configure your mounted directories, make sure the folder 'public' and 'storage'
|
# Configure your mounted directories, make sure the folder 'public' and 'storage'
|
||||||
# exist, before mounting them
|
# exist, before mounting them
|
||||||
- public:/var/www/app/public
|
|
||||||
- storage:/var/www/app/storage
|
|
||||||
# you may use a bind-mounted host directory instead, so that it is harder to accidentally remove the volume and lose all your data!
|
# you may use a bind-mounted host directory instead, so that it is harder to accidentally remove the volume and lose all your data!
|
||||||
# - ./docker/app/public:/var/www/app/public:rw,delegated
|
- ./docker/app/public:/var/www/app/public:rw,delegated
|
||||||
# - ./docker/app/storage:/var/www/app/storage:rw,delegated
|
- ./docker/app/storage:/var/www/app/storage:rw,delegated
|
||||||
depends_on:
|
depends_on:
|
||||||
- app
|
- app
|
||||||
# Run webserver nginx on port 80
|
# Run webserver nginx on port 80
|
||||||
# Feel free to modify depending what port is already occupied
|
# Feel free to modify depending what port is already occupied
|
||||||
ports:
|
ports:
|
||||||
- "80:80"
|
- "8003:80"
|
||||||
- "443:443"
|
#- "443:443"
|
||||||
networks:
|
networks:
|
||||||
- invoiceninja
|
- invoiceninja
|
||||||
|
|
||||||
app:
|
app:
|
||||||
image: invoiceninja/invoiceninja:5
|
image: invoiceninja/invoiceninja:5
|
||||||
|
env_file: env
|
||||||
restart: always
|
restart: always
|
||||||
cap_add:
|
cap_add:
|
||||||
- SYS_ADMIN
|
- SYS_ADMIN
|
||||||
environment:
|
|
||||||
- APP_URL=https://localhost
|
|
||||||
- APP_KEY=<INSERT THE GENERATED APPLICATION KEY HERE>
|
|
||||||
- MULTI_DB_ENABLED=false
|
|
||||||
- DB_HOST1=db
|
|
||||||
- DB_USERNAME1=ninja
|
|
||||||
- DB_PASSWORD1=ninja
|
|
||||||
- DB_DATABASE1=ninja
|
|
||||||
volumes:
|
volumes:
|
||||||
# Configure your mounted directories, make sure the folder 'public' and 'storage'
|
|
||||||
# exist, before mounting them
|
|
||||||
- public:/var/www/app/public
|
|
||||||
- storage:/var/www/app/storage
|
|
||||||
# you may use a bind-mounted host directory instead, so that it is harder to accidentally remove the volume and lose all your data!
|
# you may use a bind-mounted host directory instead, so that it is harder to accidentally remove the volume and lose all your data!
|
||||||
# - ./docker/app/public:/var/www/app/public:rw,delegated
|
- ./config/hosts:/etc/hosts:ro
|
||||||
# - ./docker/app/storage:/var/www/app/storage:rw,delegated
|
- ./docker/app/public:/var/www/app/public:rw,delegated
|
||||||
|
- ./docker/app/storage:/var/www/app/storage:rw,delegated
|
||||||
depends_on:
|
depends_on:
|
||||||
- db
|
- db
|
||||||
networks:
|
networks:
|
||||||
@@ -55,6 +43,8 @@ services:
|
|||||||
|
|
||||||
db:
|
db:
|
||||||
image: mysql:5
|
image: mysql:5
|
||||||
|
ports:
|
||||||
|
- "3305:3306"
|
||||||
restart: always
|
restart: always
|
||||||
environment:
|
environment:
|
||||||
- MYSQL_ROOT_PASSWORD=ninjaAdm1nPassword
|
- MYSQL_ROOT_PASSWORD=ninjaAdm1nPassword
|
||||||
@@ -62,9 +52,27 @@ services:
|
|||||||
- MYSQL_PASSWORD=ninja
|
- MYSQL_PASSWORD=ninja
|
||||||
- MYSQL_DATABASE=ninja
|
- MYSQL_DATABASE=ninja
|
||||||
volumes:
|
volumes:
|
||||||
- mysql-data:/var/lib/mysql:rw
|
|
||||||
# you may use a bind-mounted host directory instead, so that it is harder to accidentally remove the volume and lose all your data!
|
# you may use a bind-mounted host directory instead, so that it is harder to accidentally remove the volume and lose all your data!
|
||||||
# - ./docker/mysql/data:/var/lib/mysql:rw,delegated
|
- ./docker/mysql/data:/var/lib/mysql:rw,delegated
|
||||||
|
networks:
|
||||||
|
- invoiceninja
|
||||||
|
|
||||||
|
# THIS IS ONLY A VALID CONFIGURATION FOR IN 5. DO NOT USE FOR IN 4.
|
||||||
|
cron:
|
||||||
|
image: invoiceninja/invoiceninja:5
|
||||||
|
env_file: env
|
||||||
|
volumes:
|
||||||
|
- ./config/hosts:/etc/hosts:ro
|
||||||
|
- ./docker/app/public:/var/www/app/public:rw,delegated
|
||||||
|
- ./docker/app/storage:/var/www/app/storage:rw,delegated
|
||||||
|
entrypoint: |
|
||||||
|
/bin/sh -c 'sh -s <<EOF
|
||||||
|
trap "break;exit" SIGHUP SIGINT SIGTERM
|
||||||
|
while true; do
|
||||||
|
php artisan schedule:run;
|
||||||
|
sleep 60s
|
||||||
|
done
|
||||||
|
EOF'
|
||||||
networks:
|
networks:
|
||||||
- invoiceninja
|
- invoiceninja
|
||||||
|
|
||||||
@@ -87,13 +95,7 @@ services:
|
|||||||
# EOF'
|
# EOF'
|
||||||
# networks:
|
# networks:
|
||||||
# - invoiceninja
|
# - invoiceninja
|
||||||
|
#
|
||||||
volumes:
|
|
||||||
mysql-data:
|
|
||||||
public:
|
|
||||||
storage:
|
|
||||||
# This is needed for letting th cron run correctly
|
|
||||||
# logo:
|
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
invoiceninja:
|
invoiceninja:
|
||||||
1
docker/app/public/.keep
Normal file
1
docker/app/public/.keep
Normal file
@@ -0,0 +1 @@
|
|||||||
|
|
||||||
1
docker/app/storage/.keep
Normal file
1
docker/app/storage/.keep
Normal file
@@ -0,0 +1 @@
|
|||||||
|
|
||||||
Reference in New Issue
Block a user