cor docker Dev/Prod
This commit is contained in:
parent
3ac3e9ac8e
commit
d15fa9a57d
|
|
@ -3,4 +3,4 @@
|
|||
|
||||
agent/node_modules
|
||||
|
||||
scrapper/node_modules
|
||||
scrapper/node_modules
|
||||
|
|
|
|||
|
|
@ -169,7 +169,7 @@ class Scraper {
|
|||
|
||||
async getNewToken(email, password) {
|
||||
|
||||
try {
|
||||
try {
|
||||
const response = await fetch(this._JucundusUrl+'/authenticate', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ Dev :
|
|||
|
||||
```bash
|
||||
docker-compose -f docker-compose-dev.yml build
|
||||
docker-compose -f docker-compose-dev.yml up
|
||||
docker-compose -f docker-compose-dev.yml up --scale agent=3
|
||||
```
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,15 @@
|
|||
// Config Dev
|
||||
console.log('## CONFIG DEV ##');
|
||||
|
||||
const config = {
|
||||
jucundus: {
|
||||
url: 'http://host.docker.internal:3000',
|
||||
useremail: 'agent@agent.com'
|
||||
},
|
||||
agent: {
|
||||
urlApi: 'http://agent/internApi',
|
||||
maxCloseWebsockets: 5,
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = { config };
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
const config = {
|
||||
jucundus: {
|
||||
url: 'http://host.docker.internal:3000',
|
||||
useremail: 'agent@agent.com'
|
||||
},
|
||||
agent: {
|
||||
urlApi: 'http://agent/internApi',
|
||||
maxCloseWebsockets: 5,
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = { config };
|
||||
|
|
@ -1,6 +1,8 @@
|
|||
// Config Prod
|
||||
|
||||
const config = {
|
||||
jucundus: {
|
||||
url: 'http://jucundus-api.saucisse.ninja',
|
||||
url: 'https://jucundus-api.saucisse.ninja',
|
||||
useremail: 'agent@agent.com'
|
||||
},
|
||||
agent: {
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@ services:
|
|||
volumes:
|
||||
- ./agent:/agent
|
||||
- ./.Key.js:/agent/.Key.js
|
||||
- ./config-dev.js:/agent/config.js
|
||||
- ./AuctionServices:/agent/AuctionServices
|
||||
networks:
|
||||
- internal
|
||||
|
|
@ -24,7 +23,6 @@ services:
|
|||
volumes:
|
||||
- ./scrapper:/scrapper
|
||||
- ./.Key.js:/scrapper/.Key.js
|
||||
- ./config-dev.js:/scrapper/config.js
|
||||
- ./AuctionServices:/scrapper/AuctionServices
|
||||
networks:
|
||||
- internal
|
||||
|
|
|
|||
|
|
@ -6,32 +6,31 @@ services:
|
|||
context: ./agent
|
||||
dockerfile: Dockerfile
|
||||
volumes:
|
||||
- ./agent:/agent
|
||||
- ./.Key.js:/agent/.Key.js
|
||||
- ./config.js:/agent/config.js
|
||||
- ./AuctionServices:/agent/AuctionServices
|
||||
networks:
|
||||
- internal
|
||||
|
||||
# scrapper:
|
||||
# build:
|
||||
# context: ./scrapper
|
||||
# dockerfile: Dockerfile
|
||||
# ports:
|
||||
# - 3020
|
||||
# volumes:
|
||||
# - ./scrapper:/scrapper
|
||||
# - ./.Key.js:/scrapper/.Key.js
|
||||
# - ./config.js:/scrapper/config.js
|
||||
# - ./AuctionServices:/scrapper/AuctionServices
|
||||
# networks:
|
||||
# - internal
|
||||
# labels:
|
||||
# - "traefik.enable=true"
|
||||
# - "traefik.http.routers.backend.rule=Host(`jucundus-agent1.saucisse.ninja`)"
|
||||
# - "traefik.http.routers.backend.entrypoints=websecure"
|
||||
# - "traefik.http.routers.backend.tls=true"
|
||||
# - "traefik.http.routers.backend.tls.certresolver=myresolver"
|
||||
scrapper:
|
||||
build:
|
||||
context: ./scrapper
|
||||
dockerfile: Dockerfile
|
||||
ports:
|
||||
- "3020"
|
||||
volumes:
|
||||
- ./.Key.js:/scrapper/.Key.js
|
||||
- ./config.js:/scrapper/config.js
|
||||
- ./AuctionServices:/scrapper/AuctionServices
|
||||
networks:
|
||||
- internal
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
- "traefik.http.routers.jucundus-agent1.rule=Host(`jucundus-agent1.saucisse.ninja`)"
|
||||
- "traefik.http.routers.jucundus-agent1.entrypoints=websecure"
|
||||
- "traefik.http.routers.jucundus-agent1.tls=true"
|
||||
- "traefik.http.routers.jucundus-agent1.tls.certresolver=myresolver"
|
||||
- "traefik.http.services.jucundus-agent1.loadbalancer.server.port=3020"
|
||||
|
||||
networks:
|
||||
internal:
|
||||
|
|
|
|||
|
|
@ -0,0 +1,15 @@
|
|||
// Config Dev
|
||||
console.log('## CONFIG DEV ##');
|
||||
|
||||
const config = {
|
||||
jucundus: {
|
||||
url: 'http://host.docker.internal:3000',
|
||||
useremail: 'agent@agent.com'
|
||||
},
|
||||
agent: {
|
||||
urlApi: 'http://agent/internApi',
|
||||
maxCloseWebsockets: 5,
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = { config };
|
||||
|
|
@ -1,20 +1,21 @@
|
|||
const fetch = require('node-fetch');
|
||||
const { config } = require("../config.js");
|
||||
|
||||
class Jucundus {
|
||||
constructor() {
|
||||
this.url = 'http://localhost:3000/api';
|
||||
this.url = config.jucundus+'/api';
|
||||
}
|
||||
|
||||
setSaleStatus(status) {
|
||||
fetch(ApiURL+'/sale/setSaleStatus/'+status)
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
res.json(data);
|
||||
})
|
||||
.catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
}
|
||||
// setSaleStatus(status) {
|
||||
// fetch(ApiURL+'/sale/setSaleStatus/'+status)
|
||||
// .then(response => response.json())
|
||||
// .then(data => {
|
||||
// res.json(data);
|
||||
// })
|
||||
// .catch(error => {
|
||||
// console.error(error);
|
||||
// });
|
||||
// }
|
||||
}
|
||||
|
||||
module.exports = Jucundus
|
||||
Loading…
Reference in New Issue