viraj-421 commited on
Commit
dab0997
·
verified ·
1 Parent(s): ee9e537

Upload folder using huggingface_hub

Browse files
Files changed (2) hide show
  1. .hfignore +5 -0
  2. Dockerfile +15 -7
.hfignore ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ .next/
2
+ node_modules/
3
+ .env.local
4
+ .git/
5
+ deploy.py
Dockerfile CHANGED
@@ -1,4 +1,4 @@
1
- FROM node:18-alpine AS base
2
 
3
  # Install dependencies only when needed
4
  FROM base AS deps
@@ -17,7 +17,11 @@ COPY --from=deps /app/node_modules ./node_modules
17
  COPY . .
18
 
19
  # Next.js telemetry is disabled
20
- ENV NEXT_TELEMETRY_DISABLED 1
 
 
 
 
21
 
22
  RUN npm run build
23
 
@@ -25,8 +29,12 @@ RUN npm run build
25
  FROM base AS runner
26
  WORKDIR /app
27
 
28
- ENV NODE_ENV production
29
- ENV NEXT_TELEMETRY_DISABLED 1
 
 
 
 
30
 
31
  RUN addgroup --system --gid 1001 nodejs
32
  RUN adduser --system --uid 1001 nextjs
@@ -43,11 +51,11 @@ COPY --from=builder --chown=nextjs:nodejs /app/public ./public
43
 
44
  USER nextjs
45
 
46
- EXPOSE 3000
47
 
48
- ENV PORT 3000
49
  # set hostname to localhost
50
- ENV HOSTNAME "0.0.0.0"
51
 
52
  # server.js is created by next build from the standalone output
53
  # https://nextjs.org/docs/pages/api-reference/next-config-js/output
 
1
+ FROM node:20-alpine AS base
2
 
3
  # Install dependencies only when needed
4
  FROM base AS deps
 
17
  COPY . .
18
 
19
  # Next.js telemetry is disabled
20
+ ENV NEXT_TELEMETRY_DISABLED=1
21
+
22
+ # Set the Gemini API key for build time
23
+ ARG GEMINI_API_KEY
24
+ ENV GEMINI_API_KEY=${GEMINI_API_KEY}
25
 
26
  RUN npm run build
27
 
 
29
  FROM base AS runner
30
  WORKDIR /app
31
 
32
+ ENV NODE_ENV=production
33
+ ENV NEXT_TELEMETRY_DISABLED=1
34
+
35
+ # Pass API key to runtime
36
+ ARG GEMINI_API_KEY
37
+ ENV GEMINI_API_KEY=${GEMINI_API_KEY}
38
 
39
  RUN addgroup --system --gid 1001 nodejs
40
  RUN adduser --system --uid 1001 nextjs
 
51
 
52
  USER nextjs
53
 
54
+ EXPOSE 7860
55
 
56
+ ENV PORT=7860
57
  # set hostname to localhost
58
+ ENV HOSTNAME="0.0.0.0"
59
 
60
  # server.js is created by next build from the standalone output
61
  # https://nextjs.org/docs/pages/api-reference/next-config-js/output