Update Docker configuration to persist uploaded images: Modify docker-compose.yml to include a volume for uploaded images, enhance Dockerfile to create the uploads directory, and update README to document the new uploads path configuration.
Some checks failed
Deploy with Docker Compose / deploy (push) Has been cancelled

This commit is contained in:
Julien Froidefond
2025-12-12 08:13:40 +01:00
parent 6f98013382
commit 09a3f6a106
3 changed files with 24 additions and 7 deletions

View File

@@ -51,12 +51,13 @@ ENV DATABASE_URL="file:/app/data/dev.db"
RUN pnpm add prisma @prisma/client @prisma/adapter-better-sqlite3 better-sqlite3 --prod && \
pnpm dlx prisma generate
# Create data directory for SQLite database
RUN mkdir -p /app/data && chown -R nextjs:nodejs /app/data
# Create data directory for SQLite database and uploads directory
RUN mkdir -p /app/data /app/public/uploads && chown -R nextjs:nodejs /app/data /app/public/uploads
RUN echo '#!/bin/sh' > /app/entrypoint.sh && \
echo 'set -e' >> /app/entrypoint.sh && \
echo 'mkdir -p /app/data' >> /app/entrypoint.sh && \
echo 'mkdir -p /app/public/uploads' >> /app/entrypoint.sh && \
echo 'pnpm dlx prisma migrate deploy || true' >> /app/entrypoint.sh && \
echo 'exec node server.js' >> /app/entrypoint.sh && \
chmod +x /app/entrypoint.sh && \