Fix database path to avoid volume conflicts and update compose

This commit is contained in:
2026-01-12 21:17:19 +01:00
parent 3ba1e59ecf
commit 04c53b2743
2 changed files with 4 additions and 3 deletions

View File

@@ -9,7 +9,7 @@ RUN npm install
# Build the application # Build the application
COPY . . COPY . .
ENV DATABASE_URL="file:./prisma/dev.db" ENV DATABASE_URL="file:/app/data/dev.db"
RUN npx prisma generate RUN npx prisma generate
RUN npm run build RUN npm run build
@@ -19,7 +19,7 @@ WORKDIR /app
ENV NODE_ENV=production ENV NODE_ENV=production
ENV PORT=3000 ENV PORT=3000
ENV DATABASE_URL="file:./prisma/dev.db" ENV DATABASE_URL="file:/app/data/dev.db"
# Install production dependencies only # Install production dependencies only
COPY package*.json ./ COPY package*.json ./
@@ -39,6 +39,7 @@ COPY --from=builder /app/node_modules/.prisma ./node_modules/.prisma
COPY --from=builder /app/node_modules/@prisma ./node_modules/@prisma COPY --from=builder /app/node_modules/@prisma ./node_modules/@prisma
# Script to run migrations and start the app # Script to run migrations and start the app
RUN mkdir -p /app/data
RUN printf "#!/bin/sh\nnpx prisma migrate deploy\nnpm start" > /app/start.sh RUN printf "#!/bin/sh\nnpx prisma migrate deploy\nnpm start" > /app/start.sh
RUN chmod +x /app/start.sh RUN chmod +x /app/start.sh

View File

@@ -4,5 +4,5 @@ services:
ports: ports:
- "3000:3000" - "3000:3000"
volumes: volumes:
- ./data:/app/prisma - ./data:/app/data
restart: always restart: always