我想构建自定义 Dockerfile,但我收到以下消息:
--> Starting build app
ERROR: The Compose file is invalid because:
Service app has neither an image nor a build context specified. At least one must be provided.
我不明白为什么叫这个名字app。你可以看到我的 docker-compose.yml 文件:
version: "3"
services:
webapp-react:
build:
context: ./docker/nodejs
dockerfile: Dockerfile
image: webapp/react
container_name: webapp_react
user: ${UID}:${GID}
environment:
- NODE_ENV=build
webapp-nginx:
build:
context: ./docker/nginx
dockerfile: Dockerfile
image: webapp/nginx
container_name: webapp_nginx
environment:
- VIRTUAL_HOST=${SITE_URL}
- VIRTUAL_PORT=8080
- VIRTUAL_NETWORK=nginx-proxy
- LETSENCRYPT_HOST=${SITE_URL}
- LETSENCRYPT_EMAIL=${MAILER_DEFAUT_SENDER_ADDRESS}
ports:
- "8181:80"
volumes:
- ./app/build:/www-data/ …Run Code Online (Sandbox Code Playgroud) 我使用jsonplaceholder URL测试fetch API,但我的函数返回"Promise State:Pending",我不明白为什么:
function getUsers(url) {
return fetch(url)
}
const users = getUsers(`https://jsonplaceholder.typicode.com/users`);
users.then(response => {
console.log(response.text());
});
Run Code Online (Sandbox Code Playgroud)
我认为问题是因为异步/同步方法?
我想将Vue与webpack一起使用。我已经安装了所有依赖项,但是在编译后发出了警告:
[Vue警告]:您正在使用Vue的仅运行时版本,而模板编译器不可用。可以将模板预编译为渲染函数,也可以使用包含编译器的内部版本。(在发现 )
我的app.js:
import Vue from 'vue';
import test from './components/cartItem.vue'; // Simple <template> with string
new Vue({
el: '#js-cart-list'
});
Run Code Online (Sandbox Code Playgroud)
我的package.json:
"devDependencies": {
"autoprefixer": "^6.4.1",
"babel-core": "^6.14.0",
"babel-loader": "^6.2.5",
"babel-polyfill": "^6.23.0",
"babel-preset-es2015": "^6.14.0",
"babel-preset-stage-2": "^6.13.0",
"browser-sync": "^2.14.3",
"cross-env": "^3.2.4",
"css-loader": "^0.24.0",
"css-mqpacker": "^5.0.1",
"eslint": "^3.18.0",
"eslint-loader": "^1.6.3",
"exports-loader": "^0.6.3",
"extract-text-webpack-plugin": "^2.1.0",
"goog-webfont-dl": "^1.0.1",
"node-sass": "^3.8.0",
"postcss-loader": "^0.11.1",
"progress-bar-webpack-plugin": "^1.9.0",
"sass-loader": "^4.0.1",
"script-loader": "^0.7.0",
"slick-carousel": "^1.6.0",
"style-loader": "^0.13.1",
"vue-loader": "^11.3.4",
"vue-template-compiler": "^2.2.6",
"webpack": "^2.0.0",
"webpack-notifier": "^1.5.0"
},
"dependencies": { …Run Code Online (Sandbox Code Playgroud) 我用它构建了我的第一个Meteor APP meteor build ../build.
但是,当我启动我的应用程序时node main.js,我错了,因为Meteor搜索信息在我的settings.json中,但是找不到此信息.
你知道设置是否构建?
谢谢大家,
我想在我的 js 文件顶部添加字符串。事实上,已经到了最后:
var file = './public/js/app.bundleES6.js',
string = '// My string';
fs.appendFileSync(file, string);
Run Code Online (Sandbox Code Playgroud)
您有想法在第一行添加我的字符串吗?
谢谢 !
docker ×1
ecmascript-6 ×1
fetch-api ×1
fs ×1
javascript ×1
json ×1
meteor ×1
node.js ×1
vue.js ×1
webpack ×1