Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

540
Views
docker php-fpm: the connection between services by port 9000 fails

I'm setting up a config to run my environment. I've a mysql, redis, nginx and php-fpm.

The services mysql and redis are ok, but when I start nginx and php my environment don't run.

The nginx config call to fastcgi_pass: php:9000

The error is:

[error] 6#6: *1 connect() failed (113: No route to host) while connecting to upstream, client: 192.168.224.1, server: ~.*, request: "POST /sellers HTTP/1.1", upstream: "fastcgi://192.168.224.4:9000", host: "127.0.0.1:8080"

My Dockerfile is:

FROM php:7.2-fpm-alpine

WORKDIR /app

# Install composer
RUN apk --update add curl && rm /var/cache/apk/*
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/bin --filename=composer

RUN docker-php-ext-install pdo pdo_mysql

# Copy files
COPY . /app/

## THE LIFE SAVER
ADD https://github.com/ufoscout/docker-compose-wait/releases/download/2.2.1/wait /wait
RUN chmod +x /wait

RUN composer up
CMD /wait && bin/console doctrine:migrations:migrate

and my docker-compose is:

version: '3'

services:
  mysql:
    image: mysql:5.7
    restart: unless-stopped
    ports:
      - '3306:3306'
    environment:
      MYSQL_ROOT_PASSWORD: database
      MYSQL_DATABASE: cart

  redis:
    image: redis:alpine
    ports:
      - '6379:6379'

  web:
    image: nginx:latest
    depends_on:
      - php
    ports:
      - '8080:80'
    volumes:
      - .:/app
      - ./docker/site.conf:/etc/nginx/conf.d/site.conf

  php:
    build:
      context: .
    depends_on:
      - mysql
    volumes:
      - .:/app
    environment:
      - APP_ENV=prod
      - APP_SECRET=aaaa
      - DATABASE_URL=mysql://root:database@mysql:3306/cart
      - REDIS_HOST=redis
      - REDIS_PORT=6379
      - WAIT_HOSTS= mysql:3306
over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!