Gmagl commited on
Commit
804b1e6
·
1 Parent(s): 5bd958b

Fix: Simplified Dockerfile for HF Spaces

Browse files
Files changed (1) hide show
  1. Dockerfile +13 -35
Dockerfile CHANGED
@@ -1,56 +1,34 @@
1
- FROM node:20-alpine AS builder
2
-
3
- # Install bun
4
- RUN npm install -g bun
5
 
6
  WORKDIR /app
7
 
8
- # Copy package files first
 
 
 
9
  COPY package.json bun.lock ./
10
 
11
- # Install dependencies
12
- RUN bun install --frozen-lockfile
13
 
14
- # Copy source files
15
  COPY . .
16
 
17
- # Generate Prisma client
18
  RUN bunx prisma generate
19
 
20
- # Build the application
21
- RUN bun run build
22
-
23
- # Production image
24
- FROM node:20-alpine
25
-
26
- WORKDIR /app
27
-
28
- # Install bun
29
- RUN npm install -g bun
30
-
31
- # Copy built application from builder
32
- COPY --from=builder /app/.next ./.next
33
- COPY --from=builder /app/public ./public
34
- COPY --from=builder /app/package.json ./
35
- COPY --from=builder /app/bun.lock ./
36
- COPY --from=builder /app/prisma ./prisma
37
- COPY --from=builder /app/node_modules ./node_modules
38
- COPY --from=builder /app/next.config.ts ./
39
-
40
- # Create data directory for SQLite
41
  RUN mkdir -p /app/data
42
 
43
- # Set environment variables
44
  ENV NODE_ENV=production
45
  ENV DATABASE_URL="file:/app/data/sofia.db"
46
  ENV PORT=3000
47
  ENV HOST=0.0.0.0
48
 
49
- # Copy and setup entrypoint
50
- COPY entrypoint.sh /entrypoint.sh
51
- RUN chmod +x /entrypoint.sh
52
 
53
  EXPOSE 3000
54
 
55
- ENTRYPOINT ["/entrypoint.sh"]
56
  CMD ["bun", "start"]
 
1
+ FROM node:20-alpine
 
 
 
2
 
3
  WORKDIR /app
4
 
5
+ # Instalar bun
6
+ RUN npm install -g bun
7
+
8
+ # Copiar archivos de dependencias
9
  COPY package.json bun.lock ./
10
 
11
+ # Instalar dependencias
12
+ RUN bun install
13
 
14
+ # Copiar el resto de archivos
15
  COPY . .
16
 
17
+ # Generar Prisma client
18
  RUN bunx prisma generate
19
 
20
+ # Crear directorio de datos
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
21
  RUN mkdir -p /app/data
22
 
23
+ # Variables de entorno
24
  ENV NODE_ENV=production
25
  ENV DATABASE_URL="file:/app/data/sofia.db"
26
  ENV PORT=3000
27
  ENV HOST=0.0.0.0
28
 
29
+ # Build
30
+ RUN bun run build
 
31
 
32
  EXPOSE 3000
33
 
 
34
  CMD ["bun", "start"]