Mise à jour de 'cryptide_project/Dockerfile'
continuous-integration/drone/push Build is failing
Details
continuous-integration/drone/push Build is failing
Details
parent
bc4986bf2b
commit
31a397e6da
@ -1,37 +1,19 @@
|
|||||||
# Utilisation d'une image de Node.js avec Alpine Linux comme système d'exploitation de base
|
# Fetching the latest node image on alpine linux
|
||||||
FROM node:14-alpine as builder
|
FROM node:alpine AS development
|
||||||
|
|
||||||
# Définir le répertoire de travail dans le conteneur
|
# Declaring env
|
||||||
WORKDIR /app
|
ENV NODE_ENV development
|
||||||
|
|
||||||
# Copier le package.json et le package-lock.json pour installer les dépendances
|
# Setting up the work directory
|
||||||
COPY package*.json ./
|
WORKDIR /react-app
|
||||||
|
|
||||||
|
# Installing dependencies
|
||||||
|
COPY ./package*.json /react-app
|
||||||
|
|
||||||
# Installer les dépendances
|
|
||||||
RUN npm install
|
RUN npm install
|
||||||
|
|
||||||
# Copier les fichiers du projet dans le conteneur
|
# Copying all the files in our project
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
# Construire l'application React
|
# Starting our application
|
||||||
RUN npm run build
|
CMD ["npm","start]
|
||||||
|
|
||||||
# Utiliser une image légère basée sur Node.js pour servir l'application avec serve
|
|
||||||
FROM node:14-alpine
|
|
||||||
|
|
||||||
# Installer serve globalement
|
|
||||||
RUN npm install -g serve
|
|
||||||
|
|
||||||
# Définir le répertoire de travail dans le conteneur
|
|
||||||
WORKDIR /app
|
|
||||||
|
|
||||||
# Copier les fichiers construits à partir du builder vers le répertoire de travail du serveur serve
|
|
||||||
COPY --from=builder /app/build /app
|
|
||||||
|
|
||||||
# Exposer le port 80 pour le trafic HTTP
|
|
||||||
EXPOSE 8080
|
|
||||||
|
|
||||||
RUN ls
|
|
||||||
|
|
||||||
# La commande CMD est utilisée pour démarrer serve lorsque le conteneur démarre
|
|
||||||
CMD ["serve", "-s", ".", "-p", "8080"]
|
|
Loading…
Reference in new issue