fix(backup-service): 使用 printf 替代 echo 创建启动脚本
Alpine 的 sh 不支持 echo 的 \n 转义,改用 printf。 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
9898665506
commit
9e0adca3d3
|
|
@ -40,12 +40,7 @@ COPY --from=builder /app/node_modules/.prisma ./node_modules/.prisma
|
|||
COPY --from=builder /app/prisma ./prisma
|
||||
|
||||
# Create startup script that runs migrations before starting the app
|
||||
RUN echo '#!/bin/sh\n\
|
||||
set -e\n\
|
||||
echo "Running database migrations..."\n\
|
||||
npx prisma migrate deploy || npx prisma db push --accept-data-loss\n\
|
||||
echo "Starting application..."\n\
|
||||
exec node dist/src/main.js\n' > /app/start.sh && chmod +x /app/start.sh
|
||||
RUN printf '#!/bin/sh\nset -e\necho "Running database migrations..."\nnpx prisma migrate deploy || npx prisma db push --accept-data-loss\necho "Starting application..."\nexec node dist/src/main.js\n' > /app/start.sh && chmod +x /app/start.sh
|
||||
|
||||
# Set ownership
|
||||
RUN chown -R nestjs:nodejs /app
|
||||
|
|
|
|||
Loading…
Reference in New Issue