Сообщество IT-специалистов
Ответы на любые вопросы об IT
Профессиональное развитие в IT
Удаленная работа для IT-специалистов
version: "3.8" services: foo: depends_on: - db db: image: library/postgres:11.1-alpine restart: unless-stopped hostname: 'db'
RUN psql -h db -p 5432
could not translate host name "db" to address: Name or service not known
HEALTHCHECK --interval=5s --timeout=2s --retries=5 CMD echo $POSTGRES_PASSWORD |psql --host=postgres --port=5432 --username=$POSTGRES_USER --password --dbname=$POSTGRES_DB
RUN
docker-compose
docker-compose ps
NAME COMMAND SERVICE STATUS PORTS basic-postgresql-docker-compose-postgres-1 "docker-entrypoint.s…" postgres running 0.0.0.0:5432->5432/tcp client "tail -f /dev/null" psql-client running (starting)
basic-postgresql-docker-compose-postgres-1 "docker-entrypoint.s…" postgres running 0.0.0.0:5432->5432/tcp client "tail -f /dev/null" psql-client running (healthy)
docker-compose.yaml
docker-compose.yml