feat: refs #6695 update Docker configurations and Cypress settings for improved local development
gitea/salix-front/pipeline/pr-dev There was a failure building this commit Details

This commit is contained in:
Alex Moreno 2025-02-17 14:18:57 +01:00
parent aa3c22a250
commit 574ecba4d6
5 changed files with 13 additions and 128 deletions

View File

@ -3,13 +3,14 @@ import vitePreprocessor from 'cypress-vite';
// https://docs.cypress.io/app/tooling/reporters
// https://docs.cypress.io/app/references/configuration
// https://www.npmjs.com/package/cypress-mochawesome-reporter
// baseUrl: `http://${process.env.NETWORK ? 'front' : 'localhost'}:9000`,
const baseUrl = `http://${process.env.DOCKER ? 'front' : 'localhost'}:9000`;
export default defineConfig({
e2e: {
baseUrl: `http://front:9000`,
baseUrl,
experimentalStudio: false, // Desactivado para evitar tiempos de espera innecesarios
defaultCommandTimeout: 10000,
trashAssetsBeforeRuns: false,
requestTimeout: 10000,
responseTimeout: 30000,
pageLoadTimeout: 60000,

View File

@ -1,7 +1,7 @@
version: '3.7'
services:
back:
image: registry.verdnatura.es/salix-back:25.08.0-build1314
image: registry.verdnatura.es/salix-back:dev
# image: back_try
volumes:
- ./test/cypress/storage:/salix/storage
@ -18,6 +18,7 @@ services:
working_dir: /app
environment:
- TZ=Europe/Madrid
- DOCKER=true
# ports:
# - '9000:9000'
@ -26,6 +27,7 @@ services:
command: sh -c "while [ ! -d node_modules/cypress ]; do sleep 1; done && pnpm exec cypress run --browser chromium --spec ${CYPRESS_SPEC:?}"
environment:
- TZ=Europe/Madrid
- DOCKER=true
volumes:
- .:/app
working_dir: /app
@ -38,62 +40,6 @@ services:
volumes:
- .:/app:delegated
vn-database:
image: alexmorenovn/vn_db:latest
image: registry.verdnatura.es/salix-db:dev
# ports:
# - '3306:3306'
# e2e:
# command: npx cypress run --browser chromium
# build:
# context: .
# dockerfile: ./Dockerfile.e2e
# volumes:
# - .:/app
# working_dir: /app
# front:
# # command: pnpx quasar dev
# # command: npx quasar serve --history --proxy ./proxy.mjs --hostname 127.0.0.1 --port 9000
# build:
# context: .
# dockerfile: ./Dockerfile.e2e
# network_mode: host
# e2e:
# command: pnpx cypress run --browser chromium
# build:
# context: .
# dockerfile: ./Dockerfile.e2e
# network_mode: host
# volumes:
# - ./node_modules:/app/node_modules
# db:
# image: db
# command: npx myt run -t --ci -d -n front_default
# build:
# context: .
# dockerfile: test/cypress/db/Dockerfile
# network_mode: host
# privileged: true
# volumes:
# - /var/run/docker.sock:/var/run/docker.sock
# back:
# image: back
# build:
# context: ./salix
# dockerfile: salix/back/Dockerfile
# # depends_on:
# # - db
# ports:
# - 3000:3000
# - 5000:5000
# volumes:
# - ./test/cypress/storage:/salix/storage
# e2e-2:
# image: registry.verdnatura.es/salix-frontend:${VERSION:?}
# command: npx cypress run --config-file test/cypress/configs/cypress.config.2.js
# build:
# context: .
# dockerfile: ./Dockerfile.e2e
#

View File

@ -1,15 +1,12 @@
version: '3.7'
services:
back:
image: registry.verdnatura.es/salix-back:25.08.0-build1296
# image: back_try
image: registry.verdnatura.es/salix-back:dev
volumes:
- ./test/cypress/storage:/salix/storage
- ./test/cypress/back/datasources.json:/salix/loopback/server/datasources.json
depends_on:
- vn-database
# ports:
# - '3000:3000'
front:
image: alexmorenovn/vndev:latest
command: quasar dev
@ -18,73 +15,15 @@ services:
working_dir: /app
environment:
- TZ=Europe/Madrid
# ports:
# - '9000:9000'
- DOCKER=true
e2e:
image: cypress-setup:latest
command: sh -c "while [ ! -d node_modules/cypress ]; do sleep 1; done && pnpm exec cypress run --browser chromium"
environment:
- TZ=Europe/Madrid
- DOCKER=true
volumes:
- .:/app
working_dir: /app
vn-database:
image: alexmorenovn/vn_db:latest
# ports:
# - '3306:3306'
# e2e:
# command: npx cypress run --browser chromium
# build:
# context: .
# dockerfile: ./Dockerfile.e2e
# volumes:
# - .:/app
# working_dir: /app
# front:
# # command: pnpx quasar dev
# # command: npx quasar serve --history --proxy ./proxy.mjs --hostname 127.0.0.1 --port 9000
# build:
# context: .
# dockerfile: ./Dockerfile.e2e
# network_mode: host
# e2e:
# command: pnpx cypress run --browser chromium
# build:
# context: .
# dockerfile: ./Dockerfile.e2e
# network_mode: host
# volumes:
# - ./node_modules:/app/node_modules
# db:
# image: db
# command: npx myt run -t --ci -d -n front_default
# build:
# context: .
# dockerfile: test/cypress/db/Dockerfile
# network_mode: host
# privileged: true
# volumes:
# - /var/run/docker.sock:/var/run/docker.sock
# back:
# image: back
# build:
# context: ./salix
# dockerfile: salix/back/Dockerfile
# # depends_on:
# # - db
# ports:
# - 3000:3000
# - 5000:5000
# volumes:
# - ./test/cypress/storage:/salix/storage
# e2e-2:
# image: registry.verdnatura.es/salix-frontend:${VERSION:?}
# command: npx cypress run --config-file test/cypress/configs/cypress.config.2.js
# build:
# context: .
# dockerfile: ./Dockerfile.e2e
#
image: registry.verdnatura.es/salix-db:dev

View File

@ -11,8 +11,7 @@
import { configure } from 'quasar/wrappers';
import VueI18nPlugin from '@intlify/unplugin-vue-i18n/vite';
import path from 'path';
// const target = `http://${process.env.NETWORK ? 'back' : 'localhost'}:3000`;
const target = `http://back:3000`;
const target = `http://${process.env.DOCKER ? 'back' : 'localhost'}:3000`;
export default configure(function (/* ctx */) {
return {

View File

@ -1,4 +1,4 @@
FROM mariadb:10.11.6
ENV TZ Europe/Madrid
COPY --from=mariadb-with-data /data /var/lib/mysql
COPY --from=vn-database /data /var/lib/mysql
CMD ["mysqld"]