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
|
# Etapa 1: Construcción de dependencias
|
||||||
ENV SHELL bash
|
FROM node:lts-bookworm AS builder
|
||||||
|
|
||||||
|
# Configurar PNPM
|
||||||
|
ENV SHELL=/bin/bash
|
||||||
ENV PNPM_HOME="/pnpm"
|
ENV PNPM_HOME="/pnpm"
|
||||||
ENV PATH="$PNPM_HOME:$PATH"
|
ENV PATH="$PNPM_HOME:$PATH"
|
||||||
|
|
||||||
RUN npm install -g pnpm@8.15.1 && \
|
RUN npm install -g pnpm@8.15.1 && \
|
||||||
pnpm setup
|
pnpm setup
|
||||||
|
|
||||||
|
# Actualizar e instalar paquetes necesarios
|
||||||
RUN apt-get -y --fix-missing update && \
|
RUN apt-get -y --fix-missing update && \
|
||||||
apt-get -y --fix-missing upgrade && \
|
apt-get -y --fix-missing upgrade && \
|
||||||
apt-get -y --no-install-recommends install \
|
apt-get -y --no-install-recommends install \
|
||||||
|
@ -21,27 +25,34 @@ RUN apt-get -y --fix-missing update && \
|
||||||
xauth \
|
xauth \
|
||||||
xvfb \
|
xvfb \
|
||||||
chromium \
|
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
|
WORKDIR /app
|
||||||
|
|
||||||
|
# Copiar archivos de configuración primero
|
||||||
COPY package.json .npmrc pnpm-lock.yaml ./
|
COPY package.json .npmrc pnpm-lock.yaml ./
|
||||||
|
|
||||||
|
# Verificar si node_modules existe en el contexto
|
||||||
COPY node_modules ./node_modules
|
COPY node_modules ./node_modules
|
||||||
|
|
||||||
RUN pnpm install --frozen-lockfile && \
|
# Instalar dependencias (solo si node_modules no está disponible)
|
||||||
pnpm install cypress && \
|
RUN if [ ! -d "node_modules" ]; then \
|
||||||
npx cypress install
|
pnpm install --frozen-lockfile; \
|
||||||
|
fi
|
||||||
|
|
||||||
COPY \
|
# Copiar dependencias desde la etapa de construcción
|
||||||
jsconfig.json \
|
COPY --from=builder /app/node_modules ./node_modules
|
||||||
quasar.extensions.json \
|
COPY --from=builder /app/test/cypress ./test/cypress
|
||||||
postcss.config.js \
|
COPY --from=builder /app/jsconfig.json ./jsconfig.json
|
||||||
cypress.config.js \
|
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
|
||||||
COPY test/cypress test/cypress
|
|
||||||
|
|
||||||
|
# Configuración de Cypress
|
||||||
ENV CYPRESS_BROWSER=chrome
|
ENV CYPRESS_BROWSER=chrome
|
||||||
ENV CHROME_BIN=/usr/bin/chromium
|
ENV CHROME_BIN=/usr/bin/chromium
|
||||||
|
|
||||||
|
# Comando por defecto
|
||||||
CMD ["npx", "cypress", "run"]
|
CMD ["npx", "cypress", "run"]
|
||||||
|
|
Loading…
Reference in New Issue