我有一个离子工程已经在工作和运行了。我想要修改它,所以我手动编写并添加了Dockerfile和.dockerignore。我的项目结构如下:

我的package.json:
{
"name": "example",
"version": "1.1.1",
"description": "example: An Ionic project",
"dependencies": {
"angular-messages": "^1.5.1",
"gulp": "^3.5.6",
"gulp-concat": "^2.2.0",
"gulp-minify-css": "^0.3.0",
"gulp-rename": "^1.2.0",
"gulp-sass": "^2.0.4"
},
"devDependencies": {
"bower": "^1.3.3",
"gulp-util": "^2.2.14",
"shelljs": "^0.3.0"
},
"cordovaPlugins": [
"cordova-plugin-device",
"cordova-plugin-console",
"cordova-plugin-whitelist",
"cordova-plugin-splashscreen",
"cordova-plugin-statusbar",
"ionic-plugin-keyboard"
],
"cordovaPlatforms": [
"android"
]
}我的bower.json:
{
"name": "HelloIonic",
"private": "true",
"dependencies": {
"angular": "~1.3.1",
"angular-route": "~1.3.1",
"angular-cookies": "~1.4.0",
"bootstrap": "~3.3.0",
"bootstrap-material-design": "~0.1.5",
"jquery": "~2.1.1",
"ngDialog": "~0.3.3",
"underscore": "~1.7.0",
"ionic": "^1.2.4",
"angular-resource": "^1.5.2",
"angular-google-chart": "^0.1.0",
"angular-ui-router-styles": "^1.1.0",
"angular-audio": "^1.7.2"
},
"resolutions": {
"angular": "~1.3.1"
}
}我的Dockerfile:
FROM node:4.0
COPY . /www/app
RUN npm install -g ionic cordova
RUN npm install -g bower
RUN npm install -g gulp
WORKDIR /www/app
RUN npm install
RUN echo '{"allow_root":true}' > /root/.bowerrc
RUN bower install
EXPOSE 8100 35729
ENTRYPOINT ["ionic"]
CMD ["serve", "--all", "--port", "8100", "--livereload-port", "35729"]和.dockerignore:
Dockerfile
config.xml
.sass-cache
.editorconfig
.io-config.json
.dockerignore
hooks/
platforms/
node_modules/
resources/
plugins/
www/css/*.css
*.zip
*.tar*它是成功构建的(我猜,因为没有错误),但是当我执行docker build -t ionic-preview .时,但是当我使用docker run -p 8100:8100 -it ionic-preview运行它时->它运行,但是没有加载静态文件。
我的文件有什么问题吗?或者是什么问题?
更新:通常运行我的应用程序时,我看到如下所示:

关于码头,我看到了这个:

发布于 2017-04-19 08:31:38
您还没有共享数据,如:-v /src/webapp:/webapp
所以你可以:
docker run -p 8100:8100 -v /src/webapp:/webapp -it ionic-preview把地图换成你的地图。
来源:https://docs.docker.com/engine/tutorials/dockervolumes/#locating-a-volume
https://stackoverflow.com/questions/43490348
复制相似问题