mirror of
https://github.com/InvoiceShelf/InvoiceShelf.git
synced 2026-04-07 13:41:23 +00:00
Fix SQLite docker build related issues (#458)
This commit is contained in:
committed by
GitHub
parent
3d327a1735
commit
f1635bcef8
@@ -109,13 +109,13 @@ This dockerized environment comes with support for all three databases that Invo
|
||||
|
||||
The setup parameters/credentials for each of the supported databases are as follows.
|
||||
|
||||
| | MySQL | PostgreSQL | SQLite |
|
||||
|---|---|---|---------------------------------------|
|
||||
| **DB_USER** | invoiceshelf | invoiceshelf | Not applicable |
|
||||
| **DB_PASS** | invoiceshelf | invoiceshelf | Not applicable |
|
||||
| **DB_NAME** | invoiceshelf | invoiceshelf | /var/www/html/storage/database.sqlite |
|
||||
| **DB_HOST** | db-mysql | db-pgsql | Not applicable |
|
||||
| **DB_PORT** | 3036 | 5432 | Not applicable |
|
||||
| | MySQL | PostgreSQL | SQLite |
|
||||
|---|---|---|-------------------------------------------|
|
||||
| **DB_USER** | invoiceshelf | invoiceshelf | Not applicable |
|
||||
| **DB_PASS** | invoiceshelf | invoiceshelf | Not applicable |
|
||||
| **DB_NAME** | invoiceshelf | invoiceshelf | /var/www/html/storage/app/database.sqlite |
|
||||
| **DB_HOST** | db-mysql | db-pgsql | Not applicable |
|
||||
| **DB_PORT** | 3036 | 5432 | Not applicable |
|
||||
|
||||
**Note:** The only required field for SQLite is **DB_NAME**.
|
||||
|
||||
@@ -135,11 +135,11 @@ To log into the MySQL or PostgresSQL, use the database information specified in
|
||||
|
||||
To log into the SQLite, use the following credentials:
|
||||
|
||||
| KEY | VALUE |
|
||||
|--------------|--------------------------|
|
||||
| **USERNAME** | admin |
|
||||
| **PASSWORD** | admin |
|
||||
| **DATABASE** | /storage/database.sqlite |
|
||||
| KEY | VALUE |
|
||||
|--------------|------------------------------|
|
||||
| **USERNAME** | admin |
|
||||
| **PASSWORD** | admin |
|
||||
| **DATABASE** | /storage/app/database.sqlite |
|
||||
|
||||
|
||||
### 4. Mailpit (fake mail)
|
||||
|
||||
46
docker/production/docker-compose.sqlite.yml
Normal file
46
docker/production/docker-compose.sqlite.yml
Normal file
@@ -0,0 +1,46 @@
|
||||
#-------------------------------------------
|
||||
# InvoiceShelf SQLite docker-compose variant
|
||||
# Repo : https://github.com/InvoiceShelf/docker
|
||||
#-------------------------------------------
|
||||
|
||||
services:
|
||||
webapp:
|
||||
#image: invoiceshelf/invoiceshelf:nightly
|
||||
build:
|
||||
context: ../../
|
||||
dockerfile: docker/production/Dockerfile
|
||||
container_name: invoiceshelf-sqlite
|
||||
ports:
|
||||
- "8090:8080" # 8090 is the public port.
|
||||
volumes:
|
||||
- invoiceshelf_storage:/var/www/html/storage
|
||||
networks:
|
||||
- invoiceshelf
|
||||
environment:
|
||||
- APP_NAME=InvoiceShelf
|
||||
- APP_ENV=production
|
||||
- APP_DEBUG=false
|
||||
- APP_URL=http://localhost:8090
|
||||
- DB_CONNECTION=sqlite
|
||||
- DB_DATABASE=/var/www/html/storage/app/database.sqlite # please don't touch this!
|
||||
- CACHE_STORE=file
|
||||
- SESSION_DRIVER=file
|
||||
- SESSION_LIFETIME=240
|
||||
- SESSION_DOMAIN=localhost
|
||||
- SANCTUM_STATEFUL_DOMAINS=localhost:8090
|
||||
#- MAIL_DRIVER=smtp
|
||||
#- MAIL_HOST=smtp.mailtrap.io
|
||||
#- MAIL_PORT=2525
|
||||
#- MAIL_USERNAME=null
|
||||
#- MAIL_PASSWORD=null
|
||||
#- MAIL_PASSWORD_FILE=<filename>
|
||||
#- MAIL_ENCRYPTION=null
|
||||
restart: unless-stopped
|
||||
|
||||
networks:
|
||||
invoiceshelf:
|
||||
|
||||
|
||||
volumes:
|
||||
invoiceshelf_storage:
|
||||
invoiceshelf_sqlite:
|
||||
@@ -10,20 +10,19 @@ echo "
|
||||
InvoiceShelf Version: $version
|
||||
-------------------------------------"
|
||||
|
||||
if [ -n "$STARTUP_DELAY" ]
|
||||
then echo "**** Delaying startup ($STARTUP_DELAY seconds)... ****"
|
||||
sleep $STARTUP_DELAY
|
||||
fi
|
||||
|
||||
cd /var/www/html
|
||||
|
||||
cp .env.example .env
|
||||
if [ ! -e /var/www/html/.env ]; then
|
||||
cp .env.example .env
|
||||
echo "**** Setup initial .env values ****" && \
|
||||
/inject.sh
|
||||
fi
|
||||
|
||||
if [ "$DB_CONNECTION" = "sqlite" ] || [ -z "$DB_CONNECTION" ]; then
|
||||
echo "**** Configure SQLite3 database ****"
|
||||
if [ ! -n "$DB_DATABASE" ]; then
|
||||
echo "**** DB_DATABASE not defined. Fall back to default /storage/database.sqlite location ****"
|
||||
DB_DATABASE='/var/www/html/storage/database.sqlite'
|
||||
echo "**** DB_DATABASE not defined. Fall back to default /storage/app/database.sqlite location ****"
|
||||
DB_DATABASE='/var/www/html/storage/app/database.sqlite'
|
||||
fi
|
||||
|
||||
if [ ! -e "$DB_DATABASE" ]; then
|
||||
@@ -34,9 +33,6 @@ if [ "$DB_CONNECTION" = "sqlite" ] || [ -z "$DB_CONNECTION" ]; then
|
||||
chown www-data:www-data "$DB_DATABASE"
|
||||
fi
|
||||
|
||||
echo "**** Inject .env values ****" && \
|
||||
/inject.sh
|
||||
|
||||
echo "**** Setting up artisan permissions ****"
|
||||
chmod +x artisan
|
||||
|
||||
|
||||
@@ -9,97 +9,97 @@ function replace_or_insert() {
|
||||
replace_or_insert "CONTAINERIZED" "true"
|
||||
|
||||
if [ "$APP_NAME" != '' ]; then
|
||||
replace_or_insert "APP_NAME" "$APP_NAME"
|
||||
replace_or_insert "APP_NAME" "$APP_NAME"
|
||||
fi
|
||||
if [ "$APP_ENV" != '' ]; then
|
||||
replace_or_insert "APP_ENV" "$APP_ENV"
|
||||
replace_or_insert "APP_ENV" "$APP_ENV"
|
||||
fi
|
||||
if [ "$APP_KEY" != '' ]; then
|
||||
replace_or_insert "APP_KEY" "$APP_KEY"
|
||||
replace_or_insert "APP_KEY" "$APP_KEY"
|
||||
fi
|
||||
if [ "$APP_DEBUG" != '' ]; then
|
||||
replace_or_insert "APP_DEBUG" "$APP_DEBUG"
|
||||
replace_or_insert "APP_DEBUG" "$APP_DEBUG"
|
||||
fi
|
||||
if [ "$APP_URL" != '' ]; then
|
||||
replace_or_insert "APP_URL" "$APP_URL"
|
||||
replace_or_insert "APP_URL" "$APP_URL"
|
||||
fi
|
||||
if [ "$APP_DIR" != '' ]; then
|
||||
replace_or_insert "APP_DIR" "$APP_DIR"
|
||||
replace_or_insert "APP_DIR" "$APP_DIR"
|
||||
fi
|
||||
if [ "$DB_CONNECTION" != '' ]; then
|
||||
replace_or_insert "DB_CONNECTION" "$DB_CONNECTION"
|
||||
replace_or_insert "DB_CONNECTION" "$DB_CONNECTION"
|
||||
fi
|
||||
if [ "$DB_HOST" != '' ]; then
|
||||
replace_or_insert "DB_HOST" "$DB_HOST"
|
||||
replace_or_insert "DB_HOST" "$DB_HOST"
|
||||
fi
|
||||
if [ "$DB_PORT" != '' ]; then
|
||||
replace_or_insert "DB_PORT" "$DB_PORT"
|
||||
replace_or_insert "DB_PORT" "$DB_PORT"
|
||||
fi
|
||||
if [ "$DB_DATABASE" != '' ]; then
|
||||
replace_or_insert "DB_DATABASE" "$DB_DATABASE"
|
||||
replace_or_insert "DB_DATABASE" "$DB_DATABASE"
|
||||
fi
|
||||
if [ "$DB_USERNAME" != '' ]; then
|
||||
replace_or_insert "DB_USERNAME" "$DB_USERNAME"
|
||||
replace_or_insert "DB_USERNAME" "$DB_USERNAME"
|
||||
fi
|
||||
if [ "$DB_PASSWORD" != '' ]; then
|
||||
replace_or_insert "DB_PASSWORD" "$DB_PASSWORD"
|
||||
replace_or_insert "DB_PASSWORD" "$DB_PASSWORD"
|
||||
elif [ "$DB_PASSWORD_FILE" != '' ]; then
|
||||
value=$(<$DB_PASSWORD_FILE)
|
||||
replace_or_insert "DB_PASSWORD" "$value"
|
||||
replace_or_insert "DB_PASSWORD" "$value"
|
||||
fi
|
||||
if [ "$TIMEZONE" != '' ]; then
|
||||
replace_or_insert "TIMEZONE" "$TIMEZONE"
|
||||
replace_or_insert "TIMEZONE" "$TIMEZONE"
|
||||
fi
|
||||
if [ "$CACHE_STORE" != '' ]; then
|
||||
replace_or_insert "CACHE_STORE" "$CACHE_STORE"
|
||||
replace_or_insert "CACHE_STORE" "$CACHE_STORE"
|
||||
fi
|
||||
if [ "$CACHE_DRIVER" != '' ]; then
|
||||
replace_or_insert "CACHE_STORE" "$CACHE_DRIVER" # deprecated (will be removed later)
|
||||
replace_or_insert "CACHE_STORE" "$CACHE_DRIVER" # deprecated (will be removed later)
|
||||
fi
|
||||
if [ "$SESSION_DRIVER" != '' ]; then
|
||||
replace_or_insert "SESSION_DRIVER" "$SESSION_DRIVER"
|
||||
replace_or_insert "SESSION_DRIVER" "$SESSION_DRIVER"
|
||||
fi
|
||||
if [ "$SESSION_LIFETIME" != '' ]; then
|
||||
replace_or_insert "SESSION_LIFETIME" "$SESSION_LIFETIME"
|
||||
replace_or_insert "SESSION_LIFETIME" "$SESSION_LIFETIME"
|
||||
fi
|
||||
if [ "$QUEUE_CONNECTION" != '' ]; then
|
||||
replace_or_insert "QUEUE_CONNECTION" "$QUEUE_CONNECTION"
|
||||
replace_or_insert "QUEUE_CONNECTION" "$QUEUE_CONNECTION"
|
||||
fi
|
||||
if [ "$BROADCAST_CONNECTION" != '' ]; then
|
||||
replace_or_insert "BROADCAST_CONNECTION" "$BROADCAST_CONNECTION"
|
||||
replace_or_insert "BROADCAST_CONNECTION" "$BROADCAST_CONNECTION"
|
||||
fi
|
||||
if [ "$MAIL_DRIVER" != '' ]; then
|
||||
replace_or_insert "MAIL_MAILER" "$MAIL_DRIVER"
|
||||
replace_or_insert "MAIL_MAILER" "$MAIL_DRIVER"
|
||||
fi
|
||||
if [ "$MAIL_MAILER" != '' ]; then
|
||||
replace_or_insert "MAIL_MAILER" "$MAIL_MAILER"
|
||||
replace_or_insert "MAIL_MAILER" "$MAIL_MAILER"
|
||||
fi
|
||||
if [ "$MAIL_HOST" != '' ]; then
|
||||
replace_or_insert "MAIL_HOST" "$MAIL_HOST"
|
||||
replace_or_insert "MAIL_HOST" "$MAIL_HOST"
|
||||
fi
|
||||
if [ "$MAIL_PORT" != '' ]; then
|
||||
replace_or_insert "MAIL_PORT" "$MAIL_PORT"
|
||||
replace_or_insert "MAIL_PORT" "$MAIL_PORT"
|
||||
fi
|
||||
if [ "$MAIL_USERNAME" != '' ]; then
|
||||
replace_or_insert "MAIL_USERNAME" "$MAIL_USERNAME"
|
||||
replace_or_insert "MAIL_USERNAME" "$MAIL_USERNAME"
|
||||
fi
|
||||
if [ "$MAIL_PASSWORD" != '' ]; then
|
||||
replace_or_insert "MAIL_PASSWORD" "$MAIL_PASSWORD"
|
||||
replace_or_insert "MAIL_PASSWORD" "$MAIL_PASSWORD"
|
||||
elif [ "$MAIL_PASSWORD_FILE" != '' ]; then
|
||||
value=$(<$MAIL_PASSWORD_FILE)
|
||||
replace_or_insert "MAIL_PASSWORD" "$value"
|
||||
replace_or_insert "MAIL_PASSWORD" "$value"
|
||||
fi
|
||||
if [ "$MAIL_SCHEME" != '' ]; then
|
||||
replace_or_insert "MAIL_SCHEME" "$MAIL_SCHEME"
|
||||
replace_or_insert "MAIL_SCHEME" "$MAIL_SCHEME"
|
||||
fi
|
||||
if [ "$MAIL_FROM_NAME" != '' ]; then
|
||||
replace_or_insert "MAIL_FROM_NAME" "$MAIL_FROM_NAME"
|
||||
replace_or_insert "MAIL_FROM_NAME" "$MAIL_FROM_NAME"
|
||||
fi
|
||||
if [ "$MAIL_FROM_ADDRESS" != '' ]; then
|
||||
replace_or_insert "MAIL_FROM_ADDRESS" "$MAIL_FROM_ADDRESS"
|
||||
fi
|
||||
if [ "$TRUSTED_PROXIES" != '' ]; then
|
||||
replace_or_insert "TRUSTED_PROXIES" "$TRUSTED_PROXIES"
|
||||
replace_or_insert "TRUSTED_PROXIES" "$TRUSTED_PROXIES"
|
||||
fi
|
||||
if [ "$SANCTUM_STATEFUL_DOMAINS" != '' ]; then
|
||||
replace_or_insert "SANCTUM_STATEFUL_DOMAINS" "$SANCTUM_STATEFUL_DOMAINS"
|
||||
|
||||
Reference in New Issue
Block a user