mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Split environment variables out into a .env file
- No need to collect "static" file when we are running in DEBUG mode
This commit is contained in:
parent
3381c5e257
commit
00c5a88383
1
.gitignore
vendored
1
.gitignore
vendored
@ -31,6 +31,7 @@ var/
|
||||
*.log
|
||||
local_settings.py
|
||||
*.sqlite3
|
||||
*.sqlite3-journal
|
||||
*.backup
|
||||
*.old
|
||||
|
||||
|
7
docker/dev-config.env
Normal file
7
docker/dev-config.env
Normal file
@ -0,0 +1,7 @@
|
||||
INVENTREE_DB_ENGINE=sqlite3
|
||||
INVENTREE_DB_NAME=/home/inventree/src/inventree_docker_dev.sqlite3
|
||||
INVENTREE_MEDIA_ROOT=/home/inventree/src/inventree_media
|
||||
INVENTREE_STATIC_ROOT=/home/inventree/src/inventree_static
|
||||
INVENTREE_CONFIG_FILE=/home/inventree/src/config.yaml
|
||||
INVENTREE_SECRET_KEY_FILE=/home/inventree/src/secret_key.txt
|
||||
INVENTREE_DEBUG=true
|
@ -23,14 +23,10 @@ services:
|
||||
volumes:
|
||||
# Ensure you specify the location of the 'src' directory at the end of this file
|
||||
- src:/home/inventree/src
|
||||
environment:
|
||||
# Configure a simple sqlite server for development
|
||||
# Note: You can always change to a different database backend if required!
|
||||
- INVENTREE_DB_ENGINE=sqlite3
|
||||
- INVENTREE_DB_NAME=/home/inventree/data/inventree_database.sqlite3
|
||||
- INVENTREE_MEDIA_ROOT=/home/inventree/src/inventree_media
|
||||
- INVENTREE_STATIC_ROOT=/home/inventree/src/inventree_static
|
||||
- INVENTREE_CONFIG_FILE=/home/inventree/src/config.yaml
|
||||
env_file:
|
||||
# Environment variables required for the dev server are configured in dev-config.env
|
||||
- dev-config.env
|
||||
|
||||
restart: unless-stopped
|
||||
|
||||
# Background worker process handles long-running or periodic tasks
|
||||
@ -44,13 +40,9 @@ services:
|
||||
volumes:
|
||||
# Ensure you specify the location of the 'src' directory at the end of this file
|
||||
- src:/home/inventree/src
|
||||
environment:
|
||||
# Configure a simple sqlite server for development
|
||||
# Note: You can always change to a different database backend if required!
|
||||
- INVENTREE_DB_ENGINE=sqlite3
|
||||
- INVENTREE_DB_NAME=/home/inventree/data/inventree_database.sqlite3
|
||||
- INVENTREE_MEDIA_ROOT=/home/inventree/src/inventree_media
|
||||
- INVENTREE_STATIC_ROOT=/home/inventree/src/inventree_static
|
||||
env_file:
|
||||
# Environment variables required for the dev server are configured in dev-config.env
|
||||
- dev-config.env
|
||||
restart: unless-stopped
|
||||
|
||||
volumes:
|
||||
|
@ -35,16 +35,14 @@ python manage.py wait_for_db
|
||||
|
||||
sleep 10
|
||||
|
||||
echo "Running InvenTree database migrations and collecting static files..."
|
||||
echo "Running InvenTree database migrations..."
|
||||
|
||||
# We assume at this stage that the database is up and running
|
||||
# Ensure that the database schema are up to date
|
||||
python manage.py check || exit 1
|
||||
python manage.py migrate --noinput || exit 1
|
||||
python manage.py migrate --run-syncdb || exit 1
|
||||
python manage.py prerender || exit 1
|
||||
python manage.py collectstatic --noinput || exit 1
|
||||
python manage.py clearsessions || exit 1
|
||||
|
||||
# Launch a development server
|
||||
python manage.py runserver -a 0.0.0.0:$INVENTREE_WEB_PORT
|
||||
python manage.py runserver 0.0.0.0:$INVENTREE_WEB_PORT
|
Loading…
Reference in New Issue
Block a user