This commit is contained in:
MaKarin
2026-04-06 12:50:46 +03:00
commit 73ddb1a948
155 changed files with 26688 additions and 0 deletions

9
db-seed/Dockerfile Normal file
View File

@@ -0,0 +1,9 @@
FROM postgres:16
WORKDIR /seed
COPY equipment-import.sql /seed/equipment-import.sql
COPY db-seed/import.sh /seed/import.sh
RUN chmod +x /seed/import.sh
CMD ["/seed/import.sh"]

16
db-seed/import.sh Normal file
View File

@@ -0,0 +1,16 @@
#!/bin/sh
set -eu
export PGPASSWORD="${POSTGRES_PASSWORD:-postgres}"
until pg_isready -h "${POSTGRES_HOST:-postgres}" -U "${POSTGRES_USER:-postgres}" -d "${POSTGRES_DB:-toir}"; do
sleep 2
done
if [ -f /seed/equipment-import.sql ]; then
psql \
-h "${POSTGRES_HOST:-postgres}" \
-U "${POSTGRES_USER:-postgres}" \
-d "${POSTGRES_DB:-toir}" \
-f /seed/equipment-import.sql
fi