Skip to content

Commit

Permalink
Fixed Nuxt not loading in dev environment
Browse files Browse the repository at this point in the history
For `docker-compose.override`, the `app` directory is installed in the image, the `node_modules` directory is installed as well. However, when run, then the `frontend` directory from outside is mounted instead, and the environment fails to run.

This fix has been applied: https://stackoverflow.com/a/32785014

NOTE: this does mean that any new `npm` packages installed will require a rebuild of the `frontend`.
  • Loading branch information
turukawa committed Feb 23, 2023
1 parent 6d62bd4 commit 46447f9
Show file tree
Hide file tree
Showing 4 changed files with 1,207 additions and 945 deletions.
2 changes: 2 additions & 0 deletions {{cookiecutter.project_slug}}/docker-compose.override.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@ services:

frontend:
volumes:
# https://stackoverflow.com/a/32785014
- ./frontend:/app
- ./app/node_modules
build:
context: ./frontend
target: run-dev
Expand Down
10 changes: 7 additions & 3 deletions {{cookiecutter.project_slug}}/frontend/.env
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ VUE_APP_ENV=development
# VUE_APP_ENV=staging
# VUE_APP_ENV=production
VUE_PRIVATE_TERM=example
BASE_URL={{cookiecutter.domain_base_api_url}}
VUE_APP_DOMAIN_WS={{cookiecutter.domain_base_ws_url}}
VUE_APP_DOMAIN_API={{cookiecutter.domain_base_api_url}}
# BASE_URL={{cookiecutter.domain_base_api_url}}
# VUE_APP_DOMAIN_WS={{cookiecutter.domain_base_ws_url}}
# VUE_APP_DOMAIN_API={{cookiecutter.domain_base_api_url}}
# For development
BASE_URL=http://localhost/api/v1
VUE_APP_DOMAIN_WS=ws://localhost/api/v1
VUE_APP_DOMAIN_API=http://localhost/api/v1
2 changes: 1 addition & 1 deletion {{cookiecutter.project_slug}}/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
},
"dependencies": {
"@headlessui/vue": "^1.7.3",
"@heroicons/vue": "^2.0.12",
"@heroicons/vue": "2.0.12",
"@pinia/nuxt": "^0.4.3",
"@vee-validate/i18n": "^4.7.3",
"@vee-validate/rules": "^4.7.3",
Expand Down
Loading

0 comments on commit 46447f9

Please sign in to comment.