diff --git a/Dockerfile b/Dockerfile index cebba553c..8cc31a5e3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,6 +14,8 @@ COPY package.json ./package.json COPY .next/standalone ./ COPY .next/static ./.next/static +COPY prisma/schema.prisma prisma/schema.prisma + COPY ./scripts/run.sh ./scripts/run.sh EXPOSE 7575 diff --git a/package.json b/package.json index f2e8c75eb..a92fbeac9 100644 --- a/package.json +++ b/package.json @@ -78,6 +78,7 @@ "next-auth": "^4.22.3", "next-i18next": "^13.0.0", "nzbget-api": "^0.0.3", + "prisma": "^5.0.0", "prismjs": "^1.29.0", "react": "^18.2.0", "react-dom": "^18.2.0", @@ -119,7 +120,6 @@ "happy-dom": "^10.0.0", "node-mocks-http": "^1.12.2", "prettier": "^3.0.0", - "prisma": "^5.0.0", "sass": "^1.56.1", "ts-node": "latest", "turbo": "latest", diff --git a/scripts/run.sh b/scripts/run.sh index e3fbd74c2..cc577e94f 100644 --- a/scripts/run.sh +++ b/scripts/run.sh @@ -1,4 +1,10 @@ #!/bin/sh +echo "Exporting hostname..." export NEXTAUTH_URL_INTERNAL="http://$HOSTNAME:7575" + +echo "Pushing database changes..." +npx prisma db push --skip-generate + +echo "Starting production server..." node /app/server.js \ No newline at end of file