2nzi commited on
Commit
bd0e1cd
·
verified ·
1 Parent(s): 884678f
Files changed (1) hide show
  1. Dockerfile +4 -17
Dockerfile CHANGED
@@ -1,28 +1,15 @@
1
- # Dockerfile - Version simplifiée avec serve
2
  FROM node:22.14.0-alpine AS build-stage
3
-
4
  WORKDIR /app
5
  COPY package*.json ./
6
- RUN npm ci --only=production=false
7
  COPY . .
8
  RUN npm run build
9
 
10
- FROM node:22.14.0-alpine AS production-stage
11
-
12
- # Créer l'utilisateur requis par Hugging Face
13
- RUN adduser -D -s /bin/sh -u 1000 user
14
-
15
- # Installer serve globalement
16
- RUN npm install -g serve
17
-
18
- # Passer à l'utilisateur non-root
19
  USER user
20
-
21
- # Copier les fichiers buildés
22
  WORKDIR /home/user
23
  COPY --chown=user:user --from=build-stage /app/dist ./dist
24
-
25
  EXPOSE 7860
26
-
27
- # Utiliser serve au lieu de nginx
28
  CMD ["serve", "-s", "dist", "-l", "7860"]
 
 
1
  FROM node:22.14.0-alpine AS build-stage
 
2
  WORKDIR /app
3
  COPY package*.json ./
4
+ RUN npm ci
5
  COPY . .
6
  RUN npm run build
7
 
8
+ FROM node:22.14.0-alpine
9
+ RUN adduser -D -u 1000 user
 
 
 
 
 
 
 
10
  USER user
 
 
11
  WORKDIR /home/user
12
  COPY --chown=user:user --from=build-stage /app/dist ./dist
13
+ RUN npm install -g serve
14
  EXPOSE 7860
 
 
15
  CMD ["serve", "-s", "dist", "-l", "7860"]