Skip to content

Commit 46447f9

Browse files
committed
Fixed Nuxt not loading in dev environment
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`.
1 parent 6d62bd4 commit 46447f9

File tree

4 files changed

+1207
-945
lines changed

4 files changed

+1207
-945
lines changed

{{cookiecutter.project_slug}}/docker-compose.override.yml

+2
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,9 @@ services:
7979

8080
frontend:
8181
volumes:
82+
# https://stackoverflow.com/a/32785014
8283
- ./frontend:/app
84+
- ./app/node_modules
8385
build:
8486
context: ./frontend
8587
target: run-dev

{{cookiecutter.project_slug}}/frontend/.env

+7-3
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ VUE_APP_ENV=development
99
# VUE_APP_ENV=staging
1010
# VUE_APP_ENV=production
1111
VUE_PRIVATE_TERM=example
12-
BASE_URL={{cookiecutter.domain_base_api_url}}
13-
VUE_APP_DOMAIN_WS={{cookiecutter.domain_base_ws_url}}
14-
VUE_APP_DOMAIN_API={{cookiecutter.domain_base_api_url}}
12+
# BASE_URL={{cookiecutter.domain_base_api_url}}
13+
# VUE_APP_DOMAIN_WS={{cookiecutter.domain_base_ws_url}}
14+
# VUE_APP_DOMAIN_API={{cookiecutter.domain_base_api_url}}
15+
# For development
16+
BASE_URL=http://localhost/api/v1
17+
VUE_APP_DOMAIN_WS=ws://localhost/api/v1
18+
VUE_APP_DOMAIN_API=http://localhost/api/v1

{{cookiecutter.project_slug}}/frontend/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
},
2222
"dependencies": {
2323
"@headlessui/vue": "^1.7.3",
24-
"@heroicons/vue": "^2.0.12",
24+
"@heroicons/vue": "2.0.12",
2525
"@pinia/nuxt": "^0.4.3",
2626
"@vee-validate/i18n": "^4.7.3",
2727
"@vee-validate/rules": "^4.7.3",

0 commit comments

Comments
 (0)