node と java が必要。
FROM node:lts-alpine
RUN apk add --no-cache openjdk11-jre-headless
version: "3.7"
services:
firebase:
build: .
command: npx firebase emulators:start --export-on-exit .firebase --import .firebase
ports:
- "4000:4000"
- "8080:8080"
- "9099:9099"
volumes:
- .:/workspace
- ~/.cache/firebase:/root/.cache/firebase
- ~/.config/configstore:/root/.config/configstore
working_dir: /workspace
docker-compose run firebase npm init -y
docker-compose run firebase npm i -D firebase-tools
docker-compose run firebase npx firebase login --no-localhost
docker-compose run firebase npx firebase init
host を 0.0.0.0 にする。
"emulators": {
"auth": {
"host": "0.0.0.0",
"port": 9099
},
"ui": {
"enabled": true,
"host": "0.0.0.0",
"port": 4000
},
"firestore": {
"host": "0.0.0.0",
"port": 8080
}
}
firestore の emulator を立ち上げながら functions の shell を動かすみたいな込み入ったことをやろうとすると謎の挙動が起きる。
あまり複雑なことをするのは想定されていないのかもしれない。