Compare commits

..

3 Commits

Author SHA1 Message Date
darroyo 58311ba2df Merge pull request 'develop' (#12) from develop into main
Personal/recall/pipeline/head This commit looks good
Reviewed-on: #12
2026-03-24 02:55:18 +00:00
darroyo 3ff5e6b031 fix: Improve entrypoint script with better database initialization 2026-03-23 23:54:32 -03:00
darroyo 1916bc33e4 fix: Add entrypoint script to initialize database on container start 2026-03-23 23:53:18 -03:00
2 changed files with 17 additions and 0 deletions
+3
View File
@@ -49,6 +49,8 @@ COPY --from=builder /app/prisma ./prisma
COPY --from=builder /app/node_modules/.prisma ./node_modules/.prisma
COPY --from=builder /app/prisma/schema.prisma /app/schema.prisma
COPY docker-entrypoint.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
USER nextjs
@@ -58,4 +60,5 @@ ENV PORT=3000
ENV HOSTNAME="0.0.0.0"
ENV DATABASE_URL="file:./data/dev.db"
ENTRYPOINT ["docker-entrypoint.sh"]
CMD ["node", "server.js"]
+14
View File
@@ -0,0 +1,14 @@
#!/bin/bash
set -e
# Initialize database if it doesn't exist or schema changed
echo "Checking database..."
# Create data directory if it doesn't exist
mkdir -p /app/data
# Push schema (safe - won't overwrite data, only syncs schema)
npx prisma db push --skip-generate --skip-pull
echo "Starting application..."
exec "$@"