Is there a better way to setup a local docker env. for local development? #17821
Replies: 2 comments
-
i don't think u need to copy anyway, u're running the frontend-vue/.Dockerfile FROM node:lts-alpine as global-deps-stage
RUN npm i --location=global @quasar/cli@latest
FROM global-deps-stage as develop-stage
WORKDIR /src
COPY package.json yarn.lock ./
COPY . .
FROM develop-stage as local-deps-stage
RUN yarn
FROM local-deps-stage as build-stage
CMD ["quasar", "build"]
FROM nginx:stable-alpine as production-stage
COPY --from=build-stage /src/dist/ssr /usr/share/nginx/html
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"] dev compose services:
app:
build:
context: .
dockerfile: frontend-vue/.Dockerfile
target: develop-stage
volumes:
- ./frontend-vue:/src
env_file:
- .env
ports:
- "8080:8080"
- "9229:9229"
command: /bin/sh -c "yarn & quasar dev" prod compose services:
app:
build:
context: .
dockerfile: frontend-vue/.Dockerfile
target: production-stage
volumes:
- ./frontend-vue:/src
- frontend-vue:/app
env_file:
- .env
ports:
- "80:80"
volumes:
frontend-vue: |
Beta Was this translation helpful? Give feedback.
-
Yah I tried taking it out but no glory. I have to include all those files to get things running correctly in docker for a local environment where i need hot reloading, etc... It's really weird why those files have to be copied over first for things to work but I guess that is what it is :) The command in the docker-compose file overrides the CMD in the Dockerfile so I don't think that is the issue. Thanks for the reply btw! |
Beta Was this translation helpful? Give feedback.
-
So its been awhile since i've spun up quasar within docker for local development. After battling things for a few hours ... this is what I came up with. But I'm wondering ... is there a better way (and why in the hell do i have to include index.html for things to work :))?
Dockerfile.dev:
docker-compose.dev.yaml
If anyone has any thoughts on how to improve this I'd love to hear. Thanks much!
Beta Was this translation helpful? Give feedback.
All reactions