Tag: firebase

使用Firebase侦听器的后端Java应用程序的多个实例的问题

我正在运行在docker中的后端Java应用程序(使用Spring)中工作。 此应用程序有一个Firebase实时监听器。 在本地它是完美的! 但是,当我在Docker中部署它并创build2个实例(容器)时,当我在Firebase RTDB中进行更改(它应该只执行一次)时,它开始运行相同的逻辑2次。 这是我在Bean中创build侦听器的代码: FirebaseOptions options; options = new FirebaseOptions.Builder() .setServiceAccount(new FileInputStream(resourceDir + File.separator +"test1.json")) .setDatabaseUrl("https://test1.firebaseio.com/").build(); FirebaseApp.initializeApp(options); final FirebaseDatabase database = FirebaseDatabase.getInstance(); DatabaseReference listenerRef; DatabaseReference commerceRef; commerceRef.orderByChild("got").equalTo(0).addChildEventListener(new ChildEventListener() { @Override public void onChildAdded(DataSnapshot dataSnapshot, String prevChildKey) { LOGGER.info("data changed:" + dataSnapshot.getKey()); LOGGER.info("data ref:" + dataSnapshot.getRef()); ……logic …. } catch (Exception e) { LOGGER.info("Error […]

在Google云容器中pipe理预configuration

我有一个使用Firebase作为数据库的Nodejs,React应用程序。 为了构build应用程序,我正在使用webpack。 我目前正在使用dockerfile,我已经在master分支上build立了一个构build触发器。 这是我目前的设置。 现在,问题在于configurationpipe理。 我想有两个不同的环境,“舞台”和“生产”。 两者都应该指向单独的firebase实例。 在准备构build之前,我怎样才能做到这一点,我可以下载正确的configuration,分段或生产,然后build立容器? 我曾经尝试过: 我有一个docker文件,它在构build之前从google存储中下载configuration文件: FROM node:6.11.1 # Installing yarn and pm2 RUN npm i -g yarn –silent RUN yarn global add pm2 –silent WORKDIR /app COPY . /app # Copy the config files. RUN apt-get update; apt-get install curl RUN curl -sS –fail -o config/config.js https://storage.googleapis.com/envvars-xxx/config.prod.js RUN curl -sS […]

Firebase静态主机上的主机Docker应用程序

我如何托pipe基于Docker容器的应用程序到Firebase静态托pipe? 它甚至是可行的/允许的吗? 还是应该在Digital Ocean / Vultr / Linode / AWS等服务上托pipe基于Docker的应用程序? 我使用的是Firebase作为我的主数据库,因为它提供了相同的定价模式托pipe,我想利用它,并在基于Google的服务器上拥有一切,而不是在其他地方(如Digital Ocean)托pipe并连接到我的数据库,然后将在谷歌。 谢谢

在主机操作系统中不可见的docker容器中的firebase服务

在一个docker容器中运行,主机端口可用的端口9005,当我运行 firebase serve -p 9005 然后尝试从主机os(windows)访问这个 使用http:// localhost:9005我得到一个空的回应

你有任何资源解释如何使用Firebasetesting实验室与GitLabpipe道?

我想在Firebasetesting实验室中使用espresso运行仪器testing,每次提交给GitLab中的一个分支。 我已经使用Docker和Fastlane构build,部署和发布了应用程序,但是我无法在Google上find任何将testing实验室与这些工具集成在一起的东西。 你们知道什么,我可以用它来实现与GitLab的CI系统一起运行仪器testing吗?

Docker中没有Firebase的响应

我试图从Docker容器中的node.js应用程序查询firebase。 它在本地工作,但不在容器中。 我有端口443打开,我可以向谷歌提出请求罚款。 由于某种原因,我从来没有得到一个回应在Docker容器中运行。 我怀疑这是与websockets的东西。 我的端口是:0.0.0.0:443->443/tcp,0.0.0.0:8080->8080/tcp 在我的docker syslog中::将从172.18.0.3:33288发送的意外的TCP包丢弃到216.58.210.173:443(有效的源= 192.168.65.2,0.0.0.0) 任何关于什么尝试的想法? firebase.initializeApp({ serviceAccount: firebaseKey, databaseURL: 'https://my-firebase.firebaseio.com' }); const userId = 'xxxxxxxxxxxx'; const ref = firebase.database().ref(`datasource/${userId}`) .once('value').then( (snapshot) => { console.log(snapshot.val()); return callback(null, 'ok'); }, (error) => { console.error(error); return callback(error); }); 而我的docker-compose.yml version: "2" services: test-import: build: . command: npm run dev volumes: – .:/var/www ports: […]