WIP: 5739-dockerRefactor #1822

Draft
alexm wants to merge 67 commits from 5739-dockerRefactor into dev
7 changed files with 36 additions and 10 deletions
Showing only changes of commit 61fa3a62db - Show all commits

View File

@ -23,7 +23,7 @@ services:
front:
image: front
restart: always
command: ["npm", "run", "test:front:ci"]
command: ["npx", "jest", "--ci --maxWorkers=2"]
build:
context: .
dockerfile: front/Dockerfile.test
@ -40,8 +40,18 @@ services:
- NODE_ENV
depends_on:
- db
e2e:
image: e2e
restart: always
build:
context: .
dockerfile: e2e/Dockerfile
environment:
- NODE_ENV
depends_on:
- front
networks:
stack-network:
driver: host
# networks:
# stack-network:
# driver: host

6
e2e/Dockerfile Normal file
View File

@ -0,0 +1,6 @@
FROM front
Review

Este el borrare era un intento de poder tirar els e2e

Este el borrare era un intento de poder tirar els e2e
WORKDIR /salix
COPY e2e e2e
CMD ["node", "e2e/helpers/tests.js"]

View File

@ -1,3 +1,3 @@
module.exports = {
url: 'http://localhost:5000'
url: 'http://back:5000'
};

View File

@ -4,7 +4,7 @@ require('regenerator-runtime/runtime');
require('vn-loopback/server/boot/date')();
const axios = require('axios');
const Docker = require('../../db/docker.js');
// const Docker = require('../../db/docker.js');
Review

Quitar antes de subir

Quitar antes de subir
const e2eConfig = require('./config.js');
const log = require('fancy-log');
@ -18,9 +18,9 @@ async function test() {
if (process.argv[2] === 'show')
process.env.E2E_SHOW = true;
const container = new Docker('salix-db');
// const container = new Docker('salix-db');
await container.run();
// await container.run();
const Jasmine = require('jasmine');
const jasmine = new Jasmine();
@ -56,7 +56,7 @@ async function test() {
}
async function backendStatus() {
log('Awaiting backend connection...');
log('Awaiting backend connection2...');
const milliseconds = 1000;
const maxAttempts = 10;

View File

@ -1,5 +1,6 @@
FROM back
EXPOSE 5000
WORKDIR /salix
COPY front front
RUN npm i -g jest
@ -13,6 +14,7 @@ COPY fileMock.js ./
COPY /front/gulpfile.js ./
COPY /front/webpack.config.js ./
COPY /front/salix ./front/salix
COPY /front/core ./front/core
CMD ["npx", "gulp", "front"]

7
runTestE2E.sh Normal file
View File

@ -0,0 +1,7 @@
docker-compose -p salix-test -f docker-compose.test.yml build --force-rm db
docker-compose -p salix-test -f docker-compose.test.yml build --force-rm back
docker-compose -p salix-test -f docker-compose.test.yml build --force-rm front
docker-compose -p salix-test -f docker-compose.test.yml build --force-rm e2e
docker-compose -p salix-test -f docker-compose.test.yml run e2e #--rm
# docker-compose -p salix-test -f docker-compose.test.yml down
# docker-compose -p salix-test -f docker-compose.test.yml rm

View File

@ -1,3 +1,4 @@
docker-compose -p salix-test -f docker-compose.test.yml build --force-rm front
docker-compose -p salix-test -f docker-compose.test.yml run --rm front
docker-compose -p salix-test -f docker-compose.test.yml down
docker-compose -p salix-test -f docker-compose.test.yml rm