English 中文(简体)
cker-comp等到邮袋开具 在开始当地Dockerfile集装箱之前完成
原标题:docker-compose wait for startup script of PostgreSQL to finish before starting local Dockerfile s container

I have the following docker-compose.yml file which specifies that the backend service should wait until the postgres service is healthy before starting the backend service. Apparently, postgres service is already healthy even if it is still running its startup script.

这是我的<代码>docker-compose.yml文档。

version: "3.7"
services:
  backend:
    build: .
    ports:
      - "8080:8080"
    env_file:
      - .env
    depends_on:
      postgres:
        condition: service_healthy
  postgres:
    image: postgres:13
    ports:
      - "${DB_PORT}:${DB_PORT}"
    env_file:
      - .env
    volumes:
      - ./initdb.d:/docker-entrypoint-initdb.d
      - data:/var/lib/postgresql/data
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
      interval: 5s
      timeout: 10s
      retries: 5
volumes:
  data:

我正在制作一份开张,在<条码>上运行一段时间。 启动书将用1Mrows向非洲开发银行分发。 如同开端文字运行一样,<编码>背后服务可与<代码>postgres连接。 现在,我的最佳解决办法只是增加<条码>,即:无机:<>/条码>,以等待开篇文字的填写。 是否有更强有力的办法实现这一目标?

问题回答

TL;DR; 在你的发言中添加-h 1270.0.1

在集装箱的切入点(/usr/ local/bin/docker-enterpoint.sh)中,你可以看到,在集装箱内零配件使用时,它暂时没有网络进入。

pg_ready byfallslinks to postgres over a unix socket which is available, so changing this to use tcp mimics the external web access to the protocol which achieving the demand effect.





相关问题
摘录数据

我如何将Excel板的数据输入我的Django应用? I m将PosgreSQL数据库作为数据库。

Postgres dump of only parts of tables for a dev snapshot

On production our database is a few hundred gigabytes in size. For development and testing, we need to create snapshots of this database that are functionally equivalent, but which are only 10 or 20 ...

How to join attributes in sql select statement?

I want to join few attributes in select statement as one for example select id, (name + + surname + + age) as info from users this doesn t work, how to do it? I m using postgreSQL.

What text encoding to use?

I need to setup my PostgreSQL DB s text encoding to handle non-American English characters that you d find showing up in languages such as German, Spanish, and French. What character encoding should ...

SQL LIKE condition to check for integer?

I am using a set of SQL LIKE conditions to go through the alphabet and list all items beginning with the appropriate letter, e.g. to get all books where the title starts with the letter "A": SELECT * ...

热门标签