[Vuejs]-Switch environment files in vue with docker compose

0๐Ÿ‘

โœ…

I figured it out how to do it:

In my package.json I have the following configuration

"test_build": "vue-cli-service build --mode test",
"production": "vue-cli-service build --mode production",
"development": "vue-cli-service build --mode development"

docker-compose file:

  client_test:
      args:
        - myenv=development

docker file:

ARG myenv RUN npm run $myenv

When building the project the $myenv gets passed to the build in the package.json where it then switches to the different environment files.

Leave a comment