fix: Dockerfile build arg for prisma generate + cleanup deploy
Some checks failed
Deploy API Server / build-and-deploy (push) Failing after 1m42s
Some checks failed
Deploy API Server / build-and-deploy (push) Failing after 1m42s
- Add ARG DATABASE_URL to Dockerfile so prisma generate works at build time - Fix env file path (/opt/zhixi/env/ not /etc/zhixi/) - Fix MySQL container name (mysql, not mysql-zhixi) - Use correct DB name (zhixi_prod) - Prevent duplicate mysql/redis containers from docker compose Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
parent
c64dc9c95a
commit
1fb6dd4929
@ -30,19 +30,14 @@ jobs:
|
|||||||
# Create network if missing
|
# Create network if missing
|
||||||
docker network inspect zhixi-net >/dev/null 2>&1 || docker network create zhixi-net
|
docker network inspect zhixi-net >/dev/null 2>&1 || docker network create zhixi-net
|
||||||
|
|
||||||
# Start MySQL + Redis via docker compose (try common locations)
|
# MySQL + Redis + Qdrant are managed independently (systemd/docker run)
|
||||||
for dir in /opt/zhixi /root/zhixi /tmp/api-server; do
|
docker start mysql redis qdrant 2>/dev/null || true
|
||||||
if [ -f "$dir/docker-compose.yml" ]; then
|
sleep 3
|
||||||
cd "$dir" && docker compose up -d mysql redis 2>/dev/null || true
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
sleep 5
|
|
||||||
|
|
||||||
- name: Resolve failed migrations
|
- name: Resolve failed migrations
|
||||||
run: |
|
run: |
|
||||||
MYSQL_PASS=$(docker exec mysql-zhixi printenv MYSQL_PASSWORD 2>/dev/null || echo "Zhixi@2026!App")
|
MYSQL_PASS="hKHQ+N0wBjJAiLukFu5OMEI8"
|
||||||
MYSQL_CMD="docker exec mysql-zhixi mysql -u zhixi_user -p${MYSQL_PASS} zhixi"
|
MYSQL_CMD="docker exec mysql mysql -u zhixi_user -p${MYSQL_PASS} zhixi_prod"
|
||||||
|
|
||||||
# Check for failed/stuck migrations
|
# Check for failed/stuck migrations
|
||||||
FAILED=$($MYSQL_CMD -N -e \
|
FAILED=$($MYSQL_CMD -N -e \
|
||||||
|
|||||||
@ -4,6 +4,9 @@ WORKDIR /app
|
|||||||
|
|
||||||
RUN apk add --no-cache openssl
|
RUN apk add --no-cache openssl
|
||||||
|
|
||||||
|
ARG DATABASE_URL="mysql://placeholder:placeholder@localhost:3306/placeholder"
|
||||||
|
ENV DATABASE_URL=$DATABASE_URL
|
||||||
|
|
||||||
COPY package.json package-lock.json ./
|
COPY package.json package-lock.json ./
|
||||||
RUN npm ci
|
RUN npm ci
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user