2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-05-07 07:48:50 +00:00

[dev] Devcontainer tweak (#9092)

* Remove blocking steps from devcontainer setup

* Ensure postCreateCommand.sh fails

* Mount postgres db to separate dir

- Avoid ownership issues of 'dev' dir

* Bump devcontainer docs
This commit is contained in:
Oliver 2025-02-18 12:24:49 +11:00 committed by GitHub
parent fe726afd17
commit 0404d5c137
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 11 additions and 7 deletions

View File

@ -5,7 +5,7 @@ services:
expose: expose:
- 5432/tcp - 5432/tcp
volumes: volumes:
- ../dev/psql/:/var/lib/postgresql/data:z - ../dev-db/:/var/lib/postgresql/data:z
environment: environment:
POSTGRES_DB: inventree POSTGRES_DB: inventree
POSTGRES_USER: inventree_user POSTGRES_USER: inventree_user
@ -25,12 +25,12 @@ services:
- ../:/home/inventree:z - ../:/home/inventree:z
environment: environment:
INVENTREE_DEBUG: True
INVENTREE_DB_ENGINE: postgresql INVENTREE_DB_ENGINE: postgresql
INVENTREE_DB_NAME: inventree INVENTREE_DB_NAME: inventree
INVENTREE_DB_HOST: db INVENTREE_DB_HOST: db
INVENTREE_DB_USER: inventree_user INVENTREE_DB_USER: inventree_user
INVENTREE_DB_PASSWORD: inventree_password INVENTREE_DB_PASSWORD: inventree_password
INVENTREE_DEBUG: True
INVENTREE_CACHE_HOST: redis INVENTREE_CACHE_HOST: redis
INVENTREE_CACHE_PORT: 6379 INVENTREE_CACHE_PORT: 6379
INVENTREE_PLUGINS_ENABLED: True INVENTREE_PLUGINS_ENABLED: True

View File

@ -1,4 +1,7 @@
#!/bin/bash #!/bin/bash
set -e
echo "Running postCreateCommand.sh ..."
# Avoiding Dubious Ownership in Dev Containers for setup commands that use git # Avoiding Dubious Ownership in Dev Containers for setup commands that use git
git config --global --add safe.directory /home/inventree git config --global --add safe.directory /home/inventree
@ -34,6 +37,3 @@ invoke dev.setup-dev
# Install required frontend packages # Install required frontend packages
invoke int.frontend-install invoke int.frontend-install
# Install playwright dependencies
cd src/frontend && sudo npx playwright install-deps

1
.gitignore vendored
View File

@ -81,6 +81,7 @@ js_tmp/
# Development files # Development files
dev/ dev/
dev-db/
data/ data/
env/ env/

View File

@ -76,9 +76,10 @@ repos:
additional_dependencies: ["@biomejs/biome@1.9.4"] additional_dependencies: ["@biomejs/biome@1.9.4"]
files: ^src/frontend/.*\.(js|ts|tsx)$ files: ^src/frontend/.*\.(js|ts|tsx)$
- repo: https://github.com/gitleaks/gitleaks - repo: https://github.com/gitleaks/gitleaks
rev: v8.23.1 rev: v8.23.2
hooks: hooks:
- id: gitleaks - id: gitleaks
language_version: 1.23.6
#- repo: https://github.com/jumanjihouse/pre-commit-hooks #- repo: https://github.com/jumanjihouse/pre-commit-hooks
# rev: 3.0.0 # rev: 3.0.0
# hooks: # hooks:

View File

@ -111,7 +111,9 @@ Make sure you have `gnupg` and `pinentry-mac` installed and set up correctly. Re
#### Where are the database, media files, ... stored? #### Where are the database, media files, ... stored?
Database data, backups, media/static files, venv, plugin.txt, secret_key.txt, ... are stored in the `dev` folder. If you want to start with a clean setup, you can remove that folder, but be aware that this will delete everything you already setup in InvenTree. Backups, media/static files, venv, plugin.txt, secret_key.txt, ... are stored in the `dev` folder. If you want to start with a clean setup, you can remove that folder, but be aware that this will delete everything you already setup in InvenTree.
Database data are stored in the `dev-db` directory. This is managed by the `postgres` docker container.
### Performance Improvements ### Performance Improvements