Compare commits

..

12 Commits

Author SHA1 Message Date
David Bomba
aa271a1488 Merge pull request #650 from turbo124/debian
Add index.html to public/
2024-11-25 09:14:58 +11:00
David Bomba
451c1b872f Add index.html to public/ 2024-11-25 09:14:34 +11:00
David Bomba
5c74753da2 Merge pull request #648 from turbo124/debian
Updates for resolving filessystem
2024-11-24 19:58:47 +11:00
David Bomba
83f17aa669 Updates for resolving filessystem 2024-11-24 19:56:02 +11:00
David Bomba
394c4c8b5e Merge pull request #647 from turbo124/debian
Add storage link
2024-11-24 16:17:53 +11:00
David Bomba
9ed63a6762 add storage link 2024-11-24 15:48:15 +11:00
David Bomba
cb6d6d46c2 Merge pull request #646 from turbo124/debian
Adjustments for permissions
2024-11-24 11:51:49 +11:00
David Bomba
3b0e475de6 Adjustments for permissions 2024-11-24 11:50:13 +11:00
David Bomba
d5bb90fa04 Merge pull request #644 from turbo124/debian
Fixes for permissions on container init
2024-11-24 08:44:10 +11:00
David Bomba
1b62d86659 Fixes for permissions on container init 2024-11-24 08:43:50 +11:00
David Bomba
4431abcb88 Merge pull request #643 from turbo124/debian
Updates for permission handling in the container
2024-11-23 21:00:01 +11:00
David Bomba
d05e55a24e Updates for permission handling in the container 2024-11-23 20:58:56 +11:00
6 changed files with 38 additions and 30 deletions

14
debian/.env vendored
View File

@@ -8,7 +8,16 @@ PHANTOMJS_PDF_GENERATION=false
PDF_GENERATOR=snappdf
TRUSTED_PROXIES='*'
QUEUE_CONNECTION=database
CACHE_DRIVER=redis
QUEUE_CONNECTION=redis
SESSION_DRIVER=redis
REDIS_HOST=redis
REDIS_PASSWORD=null
REDIS_PORT=6379
FILESYSTEM_DISK=debian_docker
# DB connection
DB_HOST=mysql
@@ -49,4 +58,5 @@ NORDIGEN_SECRET_KEY=
IS_DOCKER=true
SCOUT_DRIVER=null
SNAPPDF_CHROMIUM_PATH=/usr/bin/google-chrome-stable
#SNAPPDF_CHROMIUM_PATH=/usr/bin/google-chrome

18
debian/Dockerfile vendored
View File

@@ -117,16 +117,11 @@ WORKDIR /var/www/html
RUN set -eux; \
DOWNLOAD_URL=$(curl -s "https://api.github.com/repos/invoiceninja/invoiceninja/releases/latest" | \
grep -o '"browser_download_url": "[^"]*invoiceninja.tar"' | cut -d '"' -f 4) && \
echo "Downloading from: $DOWNLOAD_URL" && \
# Download and save the tar
curl -L "$DOWNLOAD_URL" -o /tmp/ninja.tar && \
# Try extraction
cd /var/www/html && \
tar -xf /tmp/ninja.tar && \
# List what was extracted
rm -f /tmp/ninja.tar && \
curl -L "$DOWNLOAD_URL" | tar -xvz -C /var/www/html && \
chown -R www-data:www-data /var/www/html
USER www-data
# Install dependencies
RUN composer install --no-dev --no-scripts --no-autoloader
@@ -135,7 +130,10 @@ RUN composer dump-autoload --optimize \
&& php artisan optimize \
&& php artisan view:cache \
&& php artisan config:cache \
&& php artisan route:cache
&& php artisan route:cache \
&& php artisan storage:link
USER root
# Setup supervisor
COPY supervisor/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
@@ -161,6 +159,8 @@ RUN mkdir -p \
/var/run \
/var/log/supervisor
RUN cp /var/www/html/resources/views/react/index.blade.php /var/www/html/public/index.html
# Set permissions
RUN chown -R www-data:www-data \
/var/www/html/storage \

View File

@@ -8,7 +8,7 @@ x-logging: &default-logging
services:
app:
image: invoiceninja/invoiceninja-debian:latest
image: invoiceninja/invoiceninja-debian:latest
restart: unless-stopped
env_file:
- ./.env
@@ -16,7 +16,7 @@ services:
- ./.env:/var/www/html/.env
- app_storage:/var/www/html/storage
- app_cache:/var/www/html/bootstrap/cache
- public_files:/var/www/html/public
- app_files:/var/www/html
networks:
- app-network
@@ -39,10 +39,8 @@ services:
volumes:
- ./nginx/conf.d:/etc/nginx/conf.d:ro
- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
- type: volume
source: public_files
target: /var/www/html/public
read_only: true
- app_files:/var/www/html:ro
networks:
- app-network
depends_on:
@@ -103,13 +101,11 @@ networks:
volumes:
app_storage:
driver: local
app_public:
driver: local
app_cache:
driver: local
mysql_data:
driver: local
redis_data:
driver: local
public_files:
driver: local
app_files:
driver: local

View File

@@ -3,7 +3,7 @@ user = www-data
group = www-data
listen = 0.0.0.0:9000
pm = dynamic
pm.max_children = 5
pm.max_children = 10
pm.start_servers = 2
pm.min_spare_servers = 1
pm.max_spare_servers = 3

View File

@@ -3,11 +3,11 @@
php artisan db:seed --force
# Build up array of arguments...
if [[ ! -z "${IN_USER_EMAIL}" ]]; then
if [ ! -z "${IN_USER_EMAIL}" ]; then
email="--email ${IN_USER_EMAIL}"
fi
if [[ ! -z "${IN_PASSWORD}" ]]; then
if [ ! -z "${IN_PASSWORD}" ]; then
password="--password ${IN_PASSWORD}"
fi

View File

@@ -36,20 +36,22 @@ mkdir -p \
/var/www/html/storage/framework/sessions \
/var/www/html/storage/framework/views \
/var/www/html/storage/logs \
/var/www/html/public/uploads
/var/www/html/public/storage
# Set directory permissions without changing ownership
chmod -R 775 \
/var/www/html/storage \
/var/www/html/bootstrap/cache \
/var/www/html/public/uploads
/var/www/html/public/storage
chown -R www-data:www-data /var/www/html/storage
# Clear and cache config in production
if [ "$APP_ENV" = "production" ]; then
php artisan config:cache
php artisan optimize
php artisan package:discover
php artisan migrate --force
gosu www-data php artisan config:cache
gosu www-data php artisan optimize
gosu www-data php artisan package:discover
gosu www-data php artisan migrate --force
echo "Checking initialization status..."