Compare commits
	
		
			4 Commits
		
	
	
		
			2eb60f12a0
			...
			ac14112eed
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| ac14112eed | |||
| 70866e7f5b | |||
| 711993220b | |||
| 54970c2d33 | 
							
								
								
									
										4
									
								
								.dockerignore
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										4
									
								
								.dockerignore
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,4 @@ | ||||
| .next/ | ||||
| node_modules/ | ||||
| .env* | ||||
| next-env.d.ts | ||||
							
								
								
									
										26
									
								
								.gitea/workflows/build.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										26
									
								
								.gitea/workflows/build.yaml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,26 @@ | ||||
| name: Build | ||||
|  | ||||
| on: | ||||
|   push: | ||||
|     branches: | ||||
|       - main | ||||
|  | ||||
| jobs: | ||||
|   build: | ||||
|     runs-on: ubuntu-latest | ||||
|     steps: | ||||
|       - name: Checkout code | ||||
|         uses: actions/checkout@v4 | ||||
|  | ||||
|       - name: Login to Docker | ||||
|         uses: https://github.com/docker/login-action@v3 | ||||
|         with: | ||||
|           registry: git.nrx.sh | ||||
|           username: ${{ secrets.docker_username }} | ||||
|           password: ${{ secrets.docker_password }} | ||||
|  | ||||
|       - name: Build Docker image | ||||
|         run: | | ||||
|           docker build -t nrx-sh:latest . && \ | ||||
|           docker tag nrx-sh:latest git.nrx.sh/naresh/nrx-sh:latest && \ | ||||
|           docker push git.nrx.sh/naresh/nrx-sh:latest | ||||
							
								
								
									
										21
									
								
								Dockerfile
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										21
									
								
								Dockerfile
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,21 @@ | ||||
| FROM node:current-alpine AS build | ||||
|  | ||||
| WORKDIR /app | ||||
|  | ||||
| COPY package.json package-lock.json ./ | ||||
| RUN npm install | ||||
|  | ||||
| COPY ./prisma ./prisma | ||||
| RUN npx prisma generate | ||||
|  | ||||
| COPY ./next.config.ts ./tsconfig.json ./eslint.config.mjs ./ | ||||
| COPY ./src ./src | ||||
|  | ||||
| RUN npm run build | ||||
| RUN cp -r .next/static .next/standalone/.next/ | ||||
|  | ||||
| FROM node:current-alpine AS production | ||||
| COPY --from=build /app/.next/standalone /app | ||||
| EXPOSE 3000 | ||||
| WORKDIR /app | ||||
| CMD ["node", "server.js"] | ||||
| @@ -7,7 +7,7 @@ import ReCAPTCHA from "react-google-recaptcha"; | ||||
| export default function ContactComponent({ | ||||
|   recaptchaSiteKey, | ||||
| }: { | ||||
|   recaptchaSiteKey: string; | ||||
|   recaptchaSiteKey: string | undefined; | ||||
| }) { | ||||
|   const inputStyle = { | ||||
|     backgroundColor: "#111", | ||||
| @@ -57,7 +57,7 @@ export default function ContactComponent({ | ||||
|             {"success" in state && "Submitted successfully!"} | ||||
|           </span> | ||||
|         )} | ||||
|         <ReCAPTCHA sitekey={recaptchaSiteKey} theme="dark" /> | ||||
|         <ReCAPTCHA sitekey={recaptchaSiteKey ?? ""} theme="dark" /> | ||||
|         <button | ||||
|           type="submit" | ||||
|           style={{ | ||||
| @@ -71,7 +71,7 @@ export default function ContactComponent({ | ||||
|           onMouseLeave={(e) => { | ||||
|             if (!pending) e.currentTarget.style.backgroundColor = "#111"; | ||||
|           }} | ||||
|           disabled={pending} | ||||
|           disabled={pending || recaptchaSiteKey == null} | ||||
|         > | ||||
|           {pending ? "Sending..." : "Submit"} | ||||
|         </button> | ||||
|   | ||||
| @@ -4,9 +4,5 @@ import ContactComponent from "./ContactComponent"; | ||||
|  | ||||
| export default async function ContactPage() { | ||||
|   const recaptchaSiteKey = process.env.RECAPTCHA_SITE_KEY; | ||||
|   if (!recaptchaSiteKey) { | ||||
|     console.error("ReCAPTCHA site key is not set"); | ||||
|     throw new Error("ReCAPTCHA not correctly configured"); | ||||
|   } | ||||
|   return <ContactComponent recaptchaSiteKey={recaptchaSiteKey} />; | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user