我正在嘗試按照此文檔部署我的angular 4 web應用程序和docker。如何在Linux上部署Docker和Azure Web App的Angular 4應用程序
Azure Web App on Linux Documentation
下面是目前我什麼泊塢文件看起來像:
# Create image based on the official Node 6 image from dockerhub
FROM node:6
# Create a directory where our app will be placed
RUN mkdir -p /usr/src/app
# Change directory so that our commands run inside this new directory
WORKDIR /usr/src/app
# Copy dependency definitions
COPY package.json /usr/src/app
# Install dependecies
RUN npm install
# Get all the code needed to run the app
COPY . /usr/src/app
# Expose the port the app runs in
EXPOSE 80
# Serve the app
CMD ["npm", "start"]
"start": "ng serve -H 0.0.0.0",
我能夠創建Web應用程序上的我的package.json currenly有這個腳本下Linux和推我的形象,但我試圖瀏覽Web應用程序時得到以下內容:
無效主機標頭
我在碼頭文件中丟失了什麼嗎?我有點卡在這一點,所以任何幫助將不勝感激。
爲什麼你需要用'ng serve'來運行它?這在理論上只是靜態內容,對吧? – Grimmy