2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-04-28 03:26:45 +00:00
InvenTree/.devcontainer/postCreateCommand.sh
Oliver 6f939931ca
Docker postgres fix (#9041)
* Update docker image

- Move from alpine 3.19 to alpine 3.21
- Move from postgres13_client to postgres17_client

* Update docker-compose file

- Move from postgres:13 to postgres:16
- Move from redis:7.0 to redis:7-alpine

* Update docs

* Update docker docs

* Separate Dockerfile for devcontainer

- Debian based (python3.11-bookworm)
- Install essential system packages

* Instal postgres client

* Further devcontainer updates

- Bump postgresql image from 13 to 15
- Store psql data in the dev/psql directory
- Install required frontend packages

* Use --host mode for frontend server

* Tweak devcontainer docs

* Bump pre commit config file

* Revert "Bump pre commit config file"

This reverts commit bbfd875ac8ea682bb7e454e5ea349943a887b6f4.
2025-02-15 08:00:12 +11:00

40 lines
1.1 KiB
Bash
Executable File

#!/bin/bash
# Avoiding Dubious Ownership in Dev Containers for setup commands that use git
git config --global --add safe.directory /home/inventree
# create venv
python3 -m venv /home/inventree/dev/venv --system-site-packages --upgrade-deps
. /home/inventree/dev/venv/bin/activate
# remove existing gitconfig created by "Avoiding Dubious Ownership" step
# so that it gets copied from host to the container to have your global
# git config in container
rm -f /home/vscode/.gitconfig
# Fix issue related to CFFI version mismatch
pip uninstall cffi -y
sudo apt remove --purge -y python3-cffi
pip install --no-cache-dir --force-reinstall --ignore-installed cffi
# Upgrade pip
python3 -m pip install --upgrade pip
# Ensure the correct invoke is available
pip3 install --ignore-installed --upgrade invoke Pillow
# install base level packages
pip3 install -Ur contrib/container/requirements.txt
# Run initial InvenTree server setup
invoke update -s
# Configure dev environment
invoke dev.setup-dev
# Install required frontend packages
invoke int.frontend-install
# Install playwright dependencies
cd src/frontend && sudo npx playwright install-deps