File tree Expand file tree Collapse file tree 4 files changed +18
-7
lines changed
Expand file tree Collapse file tree 4 files changed +18
-7
lines changed Original file line number Diff line number Diff line change 2525 JWT_SECRET=${{ secrets.JWT_SECRET }}
2626 push : true
2727 tags : coderomm/collabydraw:${{ github.sha }}
28- # # Step to deploy this to a VM
Original file line number Diff line number Diff line change @@ -2,7 +2,14 @@ import type { NextConfig } from "next";
22
33const nextConfig : NextConfig = {
44 /* config options here */
5- reactStrictMode : false ,
5+ env : {
6+ JWT_SECRET : process . env . JWT_SECRET ,
7+ DATABASE_URL : process . env . DATABASE_URL ,
8+ } ,
9+
10+ publicRuntimeConfig : {
11+ JWT_SECRET : process . env . JWT_SECRET ,
12+ } ,
613} ;
714
815export default nextConfig ;
Original file line number Diff line number Diff line change @@ -61,7 +61,7 @@ export const authOptions: NextAuthOptions = {
6161
6262 token . accessToken = jwt . sign (
6363 { id : token . id , email : token . email } ,
64- process . env . NEXTAUTH_SECRET || "" ,
64+ process . env . NEXT_PUBLIC_JWT_SECRET || "" ,
6565 { expiresIn : "7d" }
6666 ) ;
6767 return token ;
@@ -75,5 +75,5 @@ export const authOptions: NextAuthOptions = {
7575 return session ;
7676 } ,
7777 } ,
78- secret : process . env . NEXTAUTH_SECRET ,
78+ secret : process . env . NEXT_PUBLIC_JWT_SECRET ,
7979} ;
Original file line number Diff line number Diff line change @@ -8,7 +8,11 @@ WORKDIR /usr/src/app
88# Add ARG for DATABASE_URL
99ARG DATABASE_URL
1010ARG JWT_SECRET
11- # ENV DATABASE_URL=${DATABASE_URL}
11+
12+ # Set environment variables
13+ ENV DATABASE_URL=${DATABASE_URL}
14+ ENV JWT_SECRET=${JWT_SECRET}
15+ ENV NEXT_PUBLIC_JWT_SECRET=${JWT_SECRET}
1216
1317# Copy necessary files for dependency installation
1418COPY ./packages ./packages
@@ -34,9 +38,10 @@ RUN prisma generate
3438# Change back to the root directory
3539WORKDIR /usr/src/app
3640
41+ # Debug step: print environment variables
42+ RUN echo "DATABASE_URL: ${DATABASE_URL}" && echo "JWT_SECRET set: ${JWT_SECRET:+yes}"
43+
3744# Build the application with database URL
38- ENV DATABASE_URL=${DATABASE_URL}
39- ENV JWT_SECRET=${JWT_SECRET}
4045RUN pnpm run build
4146
4247# Expose the port
You can’t perform that action at this time.
0 commit comments