File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -33,6 +33,25 @@ if [ ! -f ".env" ]; then
3333 exit 1
3434fi
3535
36+ set -a
37+ . ./.env
38+ set +a
39+
40+ if [ -z " ${POSTGRES_PASSWORD:- } " ]; then
41+ echo " POSTGRES_PASSWORD 未配置,请先修改 .env"
42+ exit 1
43+ fi
44+
45+ if [ -z " ${DATABASE_URL:- } " ]; then
46+ echo " DATABASE_URL 未配置,请先修改 .env"
47+ exit 1
48+ fi
49+
50+ if [ -z " ${REDIS_URL:- } " ]; then
51+ echo " REDIS_URL 未配置,请先修改 .env"
52+ exit 1
53+ fi
54+
3655printf " 后端镜像名 [%s]: " " $APP_IMAGE "
3756read -r input_app_image || true
3857if [ -n " ${input_app_image:- } " ]; then
@@ -120,7 +139,11 @@ export APP_IMAGE_TAG="$IMAGE_TAG"
120139export EDGE_PORT
121140
122141docker compose -f " $COMPOSE_FILE " up -d postgres redis
123- docker compose -f " $COMPOSE_FILE " run --rm api prts-migrate
142+
143+ echo " 等待 PostgreSQL 就绪..."
144+ docker compose -f " $COMPOSE_FILE " exec -T postgres sh -c ' until pg_isready -U postgres -d prts_translation_system; do sleep 1; done'
145+
146+ docker compose -f " $COMPOSE_FILE " run --rm --use-aliases api prts-migrate
124147docker compose -f " $COMPOSE_FILE " up -d --remove-orphans
125148
126149echo " "
You can’t perform that action at this time.
0 commit comments