Behebe Frontend Container Startup-Fehler
- Korrigiere Syntax-Fehler im Startup-Skript des Frontend-Containers - Verbessere Datenbankmigration mit direkten Drizzle-Kit-Befehlen - Füge TSX-Dependency für TypeScript-Ausführung hinzu - Erweitere Frontend-Installationsskript mit besserer Fehlerbehandlung 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@ -15,6 +15,9 @@ COPY package.json pnpm-lock.yaml ./
|
||||
RUN pnpm install --unsafe-perm --no-optional --frozen-lockfile
|
||||
RUN pnpm rebuild better-sqlite3
|
||||
|
||||
# Install tsx for running TypeScript files directly
|
||||
RUN pnpm add -D tsx
|
||||
|
||||
# Copy source code
|
||||
COPY . .
|
||||
|
||||
@ -25,10 +28,15 @@ RUN mkdir -p db/
|
||||
EXPOSE 3000
|
||||
|
||||
# Startup script to migrate DB and start app
|
||||
RUN echo '#!/bin/sh \n\
|
||||
mkdir -p /app/db \n\
|
||||
pnpm db:migrate || echo "Migration failed, continuing anyway" \n\
|
||||
pnpm start' > /app/startup.sh && chmod +x /app/startup.sh
|
||||
RUN echo '#!/bin/sh' > /app/startup.sh && \
|
||||
echo 'set -e' >> /app/startup.sh && \
|
||||
echo 'mkdir -p /app/db' >> /app/startup.sh && \
|
||||
echo 'echo "Starting application..."' >> /app/startup.sh && \
|
||||
echo 'echo "Attempting database migration..."' >> /app/startup.sh && \
|
||||
echo 'npx drizzle-kit generate --schema=./src/server/db/schema.ts || echo "Generate schema failed, but continuing..."' >> /app/startup.sh && \
|
||||
echo 'npx drizzle-kit push:sqlite || echo "Push migration failed, but continuing..."' >> /app/startup.sh && \
|
||||
echo 'pnpm start' >> /app/startup.sh && \
|
||||
chmod +x /app/startup.sh
|
||||
|
||||
# Start the application
|
||||
CMD ["/app/startup.sh"]
|
Reference in New Issue
Block a user