From 1070308f069dec128becc4f9a5a0050a71d6c031 Mon Sep 17 00:00:00 2001 From: Kamila Paulina Godlewska Date: Thu, 18 Dec 2025 14:54:54 +0100 Subject: [PATCH 1/2] Changed oioioi_init.sh to check dependencies using `npm list`. If any package is missing or has a wrong version, the script runs `npm install` automatically when the container starts. This fixes the issue with empty node_modules on fresh install. --- oioioi_init.sh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/oioioi_init.sh b/oioioi_init.sh index 8bea4c15d..fb00c8aff 100755 --- a/oioioi_init.sh +++ b/oioioi_init.sh @@ -2,9 +2,21 @@ set -e set -x -/sio2/oioioi/wait-for-it.sh -t 60 "${DATABASE_HOST:-db}:${DATABASE_PORT:-5432}" +/sio2/oioioi/wait-for-it.sh -t 60 "db:5432" if [ "$1" == "--dev" ]; then + echo "Checking frontend dependencies..." + + if ! (cd ../oioioi && npm list --depth=0 > /dev/null 2>&1); then + echo "Dependencies mismatch or missing. Running npm install..." + (cd ../oioioi && npm install) + else + echo "Dependencies are up to date." + fi + + echo "Building frontend assets..." + (cd ../oioioi && npm run build) + ./manage.py migrate 2>&1 | tee /sio2/deployment/logs/migrate.log ./manage.py loaddata ../oioioi/extra/dbdata/default_admin.json From 0b2935dd96c622eeb3a1e510ba03149af5ef1692 Mon Sep 17 00:00:00 2001 From: Kamila Paulina Godlewska Date: Thu, 18 Dec 2025 14:59:18 +0100 Subject: [PATCH 2/2] Revert fixed db port used during tests. --- oioioi_init.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/oioioi_init.sh b/oioioi_init.sh index fb00c8aff..a924fad58 100755 --- a/oioioi_init.sh +++ b/oioioi_init.sh @@ -2,7 +2,7 @@ set -e set -x -/sio2/oioioi/wait-for-it.sh -t 60 "db:5432" +/sio2/oioioi/wait-for-it.sh -t 60 "${DATABASE_HOST:-db}:${DATABASE_PORT:-5432}" if [ "$1" == "--dev" ]; then echo "Checking frontend dependencies..."