GoGma commited on
Commit
4b63f89
verified
1 Parent(s): a1ea69f

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +26 -2
Dockerfile CHANGED
@@ -1,16 +1,40 @@
 
1
  FROM oven/bun:latest
 
2
  WORKDIR /app
3
- RUN apk add --no-cache libc6-compat openssl
 
 
 
 
 
 
 
4
  COPY package.json ./
5
- # Forzamos instalaci贸n limpia
 
6
  RUN bun install
 
 
7
  COPY . .
 
 
8
  RUN bunx prisma generate
 
 
9
  RUN bun run build
 
 
10
  RUN mkdir -p /app/data && chmod -R 777 /app/data
 
 
11
  ENV NODE_ENV=production
12
  ENV DATABASE_URL="file:/app/data/sofia.db"
13
  ENV PORT=7860
14
  ENV HOST=0.0.0.0
 
 
15
  EXPOSE 7860
 
 
16
  CMD ["bun", "run", "start"]
 
1
+ # Usamos la imagen oficial de Bun (basada en Debian)
2
  FROM oven/bun:latest
3
+
4
  WORKDIR /app
5
+
6
+ # Instalamos dependencias necesarias para Prisma y SSL usando apt (Debian)
7
+ RUN apt-get update && apt-get install -y \
8
+ openssl \
9
+ libssl-dev \
10
+ && rm -rf /var/lib/apt/lists/*
11
+
12
+ # Copiamos solo el package.json para aprovechar la cach茅 de capas
13
  COPY package.json ./
14
+
15
+ # Instalamos dependencias (sin usar el lockfile antiguo que daba error)
16
  RUN bun install
17
+
18
+ # Copiamos el resto del proyecto
19
  COPY . .
20
+
21
+ # Generamos el cliente de Prisma
22
  RUN bunx prisma generate
23
+
24
+ # Construimos la aplicaci贸n de Next.js
25
  RUN bun run build
26
+
27
+ # Configuramos la carpeta de datos para persistencia
28
  RUN mkdir -p /app/data && chmod -R 777 /app/data
29
+
30
+ # Variables de entorno para Hugging Face
31
  ENV NODE_ENV=production
32
  ENV DATABASE_URL="file:/app/data/sofia.db"
33
  ENV PORT=7860
34
  ENV HOST=0.0.0.0
35
+
36
+ # Exponemos el puerto requerido por HF
37
  EXPOSE 7860
38
+
39
+ # Comando de inicio
40
  CMD ["bun", "run", "start"]