test: refs #6695 better Dockerfile.e2e
gitea/salix-front/pipeline/pr-dev There was a failure building this commit
Details
gitea/salix-front/pipeline/pr-dev There was a failure building this commit
Details
This commit is contained in:
parent
3946e78dbf
commit
ad5d824d8c
|
@ -1,11 +1,15 @@
|
|||
FROM node:lts-bookworm
|
||||
ENV SHELL bash
|
||||
# Etapa 1: Construcción de dependencias
|
||||
FROM node:lts-bookworm AS builder
|
||||
|
||||
# Configurar PNPM
|
||||
ENV SHELL=/bin/bash
|
||||
ENV PNPM_HOME="/pnpm"
|
||||
ENV PATH="$PNPM_HOME:$PATH"
|
||||
|
||||
RUN npm install -g pnpm@8.15.1 && \
|
||||
pnpm setup
|
||||
|
||||
# Actualizar e instalar paquetes necesarios
|
||||
RUN apt-get -y --fix-missing update && \
|
||||
apt-get -y --fix-missing upgrade && \
|
||||
apt-get -y --no-install-recommends install \
|
||||
|
@ -21,27 +25,34 @@ RUN apt-get -y --fix-missing update && \
|
|||
xauth \
|
||||
xvfb \
|
||||
chromium \
|
||||
&& apt-get clean && rm -rf /var/lib/apt/lists/*
|
||||
&& apt-get clean \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Establecer directorio de trabajo
|
||||
WORKDIR /app
|
||||
|
||||
# Copiar archivos de configuración primero
|
||||
COPY package.json .npmrc pnpm-lock.yaml ./
|
||||
|
||||
# Verificar si node_modules existe en el contexto
|
||||
COPY node_modules ./node_modules
|
||||
|
||||
RUN pnpm install --frozen-lockfile && \
|
||||
pnpm install cypress && \
|
||||
npx cypress install
|
||||
# Instalar dependencias (solo si node_modules no está disponible)
|
||||
RUN if [ ! -d "node_modules" ]; then \
|
||||
pnpm install --frozen-lockfile; \
|
||||
fi
|
||||
|
||||
COPY \
|
||||
jsconfig.json \
|
||||
quasar.extensions.json \
|
||||
postcss.config.js \
|
||||
cypress.config.js \
|
||||
./
|
||||
|
||||
COPY test/cypress test/cypress
|
||||
# Copiar dependencias desde la etapa de construcción
|
||||
COPY --from=builder /app/node_modules ./node_modules
|
||||
COPY --from=builder /app/test/cypress ./test/cypress
|
||||
COPY --from=builder /app/jsconfig.json ./jsconfig.json
|
||||
COPY --from=builder /app/quasar.extensions.json ./quasar.extensions.json
|
||||
COPY --from=builder /app/postcss.config.js ./postcss.config.js
|
||||
COPY --from=builder /app/cypress.config.js ./cypress.config.js
|
||||
|
||||
# Configuración de Cypress
|
||||
ENV CYPRESS_BROWSER=chrome
|
||||
ENV CHROME_BIN=/usr/bin/chromium
|
||||
|
||||
# Comando por defecto
|
||||
CMD ["npx", "cypress", "run"]
|
||||
|
|
Loading…
Reference in New Issue