my quasar docker #13684
Replies: 4 comments 7 replies
-
|
the link is pointing somewhere else btw. |
Beta Was this translation helpful? Give feedback.
-
|
the only thing i would change is in Dockerfile, you should define the node version. |
Beta Was this translation helpful? Give feedback.
-
|
here my dockerfile: FROM node:lts-alpine as global-deps-stage
RUN npm i -g @quasar/cli@latest
FROM global-deps-stage as develop-stage
WORKDIR /src
COPY package.json ./
COPY yarn.lock ./
COPY . .
FROM develop-stage as local-deps-stage
RUN yarn
FROM local-deps-stage as build-ssr-stage
RUN quasar build -m ssr
FROM local-deps-stage as build-pwa-stage
RUN quasar build -m pwa
FROM node:lts-alpine as prod-ssr-stage
WORKDIR /app
COPY --from=build-ssr-stage /src/dist/ssr .
RUN yarn
EXPOSE 3000
CMD ["node", "index.js"]
FROM nginx:stable-alpine as prod-pwa-stage
WORKDIR /app
COPY --from=build-pwa-stage /src/dist/pwa /usr/share/nginx/html.
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]and here, my docker-compose.yml services:
my_service_name.app:
image: ${DOCKER_REGISTRY-}my_service_name_app
volumes:
- ./app:/src # ./app is where the quasar app lies.docker-compose.build.yml services:
my_service_name.app:
build:
context: ./app
dockerfile: Dockerfile
target: prod-ssr-stage
# my_service_name.app:
# build:
# context: ./app
# dockerfile: Dockerfile
# target: prod-pwa-stagedocker-compose.dev.yml services:
my_service_name.app:
build:
context: ./app
dockerfile: Dockerfile
target: develop-stage
command: /bin/sh -c "yarn && quasar upgrade -i && quasar dev -m ssr"
# my_service_name.app:
# build:
# context: ./app
# dockerfile: Dockerfile
# target: develop-stage
# command: /bin/sh -c "yarn && quasar upgrade -i && quasar dev -m pwa"my package.json scripts: "scripts": {
"dev": "docker-compose -f docker-compose.yml -f docker-compose.dev.yml up -d",
"build": "docker-compose -f docker-compose.yml -f docker-compose.build.yml up -d"
}Regarding the HMR, if u're in the windows, docker runs under the WSL, so if u source is inside a windows partition, the HMR will not capture the change in the files. in this case, i recommend u to use the VSCode and install the Remote Pack, and don't forget to clone your repo inside a Linux partition (anywhere inside the |
Beta Was this translation helpful? Give feedback.
-
|
does hot reload work with this? with docker + quasar? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi guys ,
Just wanted to share my dockerfile and docker-compose to easy deploy my quasar proyects ,
any feedback about it would be wellcome, take a look here:
https://github.com/leostereo/quasar_docker
bye
Beta Was this translation helpful? Give feedback.
All reactions