你個 Dockfile.prod 咁叻識加個 nginx 去 serve frontend vue+quasar, 因為你睇左下面條link 既教學je:
https://medium.com/@jwdobken/develop-quasar-applications-with-docker-a19c38d4a6ac
# develop stage
FROM node:13.14-alpine as develop-stage
WORKDIR /app
COPY package*.json ./
RUN yarn global add @quasar/cli
COPY . .
# build stage
FROM develop-stage as build-stage
RUN yarn
RUN quasar build
# production stage
FROM nginx:1.17.5-alpine as production-stage
COPY --from=build-stage /app/dist/spa /usr/share/nginx/html
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]
唔怪得dev齋build 就算
build d static file 出黎就完
唔似 server side code 要搵個 program run 住
求其搵個 nginx 隊住就得
你想 dev 試就加 command 落 docker-compose
command: /bin/sh -c “yarn && quasar dev”
dev env 試你用 quasar dev. 咁就多d 功能囉, 改下 code 佢 auto build auto refresh
但你 prod 唔洗要呢d 功能啦, 成個 vue/quasar 都係d js 等等 static file, 所以 build 好左 用 nginx serve 仲好
又唔洗開住個 quasar, prod 又唔會無啦啦改code; 本身 nignx 已經夠穩定
btw 同場加映:
用得 docker , d source code 有得 copy 就 copy ; 係 wordpress 有歷史因素(can update src code by button) 呢d另類先唯有用 mount