我开始使用docker,并创建了一个基本的var fileInput = document.querySelector("#xmlfile");
fileInput.addEventListener("change",function(e){
var file = fileInput.files[0];
var reader = new FileReader();
reader.onloadend = function(){
var data = reader.result;
//data will now contain the xml text
//use DOMParser to parse it
var xmlDocument = (new DOMParser()).parseFromString(data,"application/xml");
//then use the various element methods to get the elements you need
//for instance if you had a <clock> element
var clockData = xmlDocument.querySelector("clock").textContent
};
reader.readAsText(file);
})
文件。我目前面临的问题是我有多个容器需要成为一个容器。我的docker-compose.yml
文件:
docker-compose.yml
我需要一种在version: '3.7'
services:
redis:
container_name: redis
image: redis
ports:
- "6379:6379"
mongodb:
container_name: mongodb
image: mongo
environment:
MONGO_INITDB_ROOT_USERNAME: root
MONGO_INITDB_ROOT_PASSWORD: devmyoy123
ports:
- "27017:27017"
node:
container_name: node
image: node
volumes:
- ./node/:/var/app/node
environment:
REDIS_URI: redis://redis:6379
links:
- mongodb
- redis
ports:
- "9000:9000"
httpd:
container_name: httpd
image: php:7.2-apache
volumes:
- ./api/:/usr/local/apache2/htdocs
environment:
REDIS_URI: redis://redis:6379
links:
- mongodb
- redis
- node
ports:
- "80:80"
- "443:443"
容器内使用node
的方法,并且我还需要在httpd
和{{1 }}容器。