♻️ Migrate from prisma to drizzle (#1434)

* ♻️ Migrate from prisma to drizzle
* 🐛 Build issue with CalendarTile
* 🚧 Temporary solution for docker container
* 🐛 Drizzle not using DATABASE_URL
* ♻️ Address pull request feedback
* 🐛 Remove console log of env variables
* 🐛 Some unit tests not working
* 🐋 Revert docker tool changes
* 🐛 Issue with board slug page for logged in users

---------

Co-authored-by: Thomas Camlong <thomascamlong@gmail.com>
This commit is contained in:
Meier Lukas
2023-10-08 12:10:48 +02:00
committed by GitHub
parent 4945725702
commit 1d50e2ce9a
34 changed files with 3274 additions and 1507 deletions

View File

@@ -10,24 +10,31 @@ ENV NODE_OPTIONS '--no-experimental-fetch'
COPY next.config.js ./
COPY public ./public
COPY package.json ./package.json
COPY yarn.lock ./yarn.lock
COPY package.json ./temp_package.json
COPY yarn.lock ./temp_yarn.lock
# Automatically leverage output traces to reduce image size
# https://nextjs.org/docs/advanced-features/output-file-tracing
COPY .next/standalone ./
COPY .next/static ./.next/static
COPY prisma/schema.prisma prisma/schema.prisma
COPY ./scripts/run.sh ./scripts/run.sh
COPY ./drizzle ./drizzle
RUN mkdir database
COPY ./src/migrate.ts ./src/migrate.ts
# Install dependencies
RUN apt-get update -y && apt-get install -y openssl
RUN yarn global add prisma
# Required for migration
RUN cp -r node_modules node_modules_cache
RUN rm -rf node_modules
RUN rm package.json
RUN yarn add typescript ts-node dotenv drizzle-orm@0.28.6 better-sqlite3@8.6.0 @types/better-sqlite3
# Expose the default application port
EXPOSE $PORT
ENV PORT=${PORT}
ENV DATABASE_URL "file:../database/db.sqlite"
ENV DATABASE_URL "file:./database/db.sqlite"
ENV NEXTAUTH_URL "http://localhost:3000"
ENV PORT 7575
ENV NEXTAUTH_SECRET NOT_IN_USE_BECAUSE_JWTS_ARE_UNUSED