Update Dockerfile to fix deps
Some checks failed
Build and Push to Registry / build-and-push (push) Failing after 29s
Some checks failed
Build and Push to Registry / build-and-push (push) Failing after 29s
This commit is contained in:
parent
164fdfb4f0
commit
180c06dc3b
@ -2,9 +2,9 @@ FROM node:19-alpine
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Installation des dépendances
|
||||
# Installation des dépendances (INCLUDING dev dependencies for build)
|
||||
COPY package*.json ./
|
||||
RUN npm install --production
|
||||
RUN npm install
|
||||
|
||||
# Copie des fichiers source
|
||||
COPY src ./src
|
||||
@ -13,11 +13,14 @@ COPY tsconfig.json ./
|
||||
# Compilation TypeScript
|
||||
RUN npm run build
|
||||
|
||||
# Nettoyage des dépendances de développement APRÈS la compilation
|
||||
RUN npm ci --only=production && npm cache clean --force
|
||||
|
||||
# Création d'un utilisateur non-root
|
||||
RUN adduser -D appuser --uid 10000 && \
|
||||
chown -R appuser /app
|
||||
USER appuser
|
||||
|
||||
# Configuration du port et démarrag
|
||||
# Configuration du port et démarrage
|
||||
EXPOSE 8080
|
||||
CMD ["npm", "start"]
|
Loading…
x
Reference in New Issue
Block a user