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
f7ce244bf2
commit
1f38a34269
|
@ -1,15 +1,11 @@
|
||||||
# Etapa 1: Construcción de dependencias
|
FROM node:lts-bookworm
|
||||||
FROM node:lts-bookworm AS builder
|
ENV SHELL bash
|
||||||
|
|
||||||
# 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 \
|
||||||
|
@ -28,31 +24,31 @@ RUN apt-get -y --fix-missing update && \
|
||||||
&& apt-get clean \
|
&& apt-get clean \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
# Establecer directorio de trabajo
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# Copiar archivos de configuración primero
|
COPY \
|
||||||
COPY package.json .npmrc pnpm-lock.yaml ./
|
package.json \
|
||||||
|
.npmrc \
|
||||||
|
pnpm-lock.yaml \
|
||||||
|
./
|
||||||
|
|
||||||
# Verificar si node_modules existe en el contexto
|
# Verifica si node_modules existe; si no, instala dependencias
|
||||||
COPY node_modules ./node_modules
|
|
||||||
|
|
||||||
# Instalar dependencias (solo si node_modules no está disponible)
|
|
||||||
RUN if [ ! -d "node_modules" ]; then \
|
RUN if [ ! -d "node_modules" ]; then \
|
||||||
pnpm install --frozen-lockfile; \
|
pnpm install; \
|
||||||
fi
|
fi && \
|
||||||
|
pnpm install cypress && \
|
||||||
|
npx cypress install
|
||||||
|
|
||||||
# Copiar dependencias desde la etapa de construcción
|
COPY \
|
||||||
COPY --from=builder /app/node_modules ./node_modules
|
jsconfig.json \
|
||||||
COPY --from=builder /app/test/cypress ./test/cypress
|
quasar.extensions.json \
|
||||||
COPY --from=builder /app/jsconfig.json ./jsconfig.json
|
postcss.config.js \
|
||||||
COPY --from=builder /app/quasar.extensions.json ./quasar.extensions.json
|
cypress.config.js \
|
||||||
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"]
|
||||||
|
|
|
@ -13,6 +13,8 @@ services:
|
||||||
context: .
|
context: .
|
||||||
dockerfile: ./Dockerfile.e2e
|
dockerfile: ./Dockerfile.e2e
|
||||||
network_mode: host
|
network_mode: host
|
||||||
|
volumes:
|
||||||
|
- ./node_modules:/app/node_modules
|
||||||
# db:
|
# db:
|
||||||
# image: db
|
# image: db
|
||||||
# command: npx myt run -t --ci -d -n front_default
|
# command: npx myt run -t --ci -d -n front_default
|
||||||
|
|
Loading…
Reference in New Issue