How to manage Firebase CLI authentication and then deployment from Docker container
This is lacking in NUXT Firebase documentation
https://nuxt.com/deploy/firebase
I have found different customer setup by different authors :
https://hovancik.net/blog/2020/08/27/working-with-firebase-tools-from-docker-with-docker-compose/
https://github.com/ynishi/firebase-cloudfunctions-docker
But still didnt manage to deploy directly from container as we need to retrieve a token from Firebase CLI with firebase.init. The one i get on my machine and saved in my
.env
is considered expired when provided to my container through the package.json script :
"scripts": {
"build": "nuxt build",
"dev": "nuxt dev",
"generate": "nuxt generate",
"preview": "nuxt preview",
"postinstall": "nuxt prepare",
"start": "node .output/server/index.mjs",
"docker-deploy-fb": "nuxt build -- --preset=firebase && firebase deploy --token $process.env.FIREBASE_TOKEN"
},