G
G
Gleb Starkov2020-01-08 11:50:29
Nginx
Gleb Starkov, 2020-01-08 11:50:29

nginx docker container not seeing php-fpm?

Hello!
I am doing my build on docker-compose php-fpm + nginx + postgres
php-fpm in docker-compose.yml is called app, it looks like this:

app:
    build:
      context: .
      dockerfile: Dockerfile
    image: digitalocean.com/php
    container_name: app
    restart: unless-stopped
    tty: true
    environment:
      SERVICE_NAME: app
      SERVICE_TAGS: dev
    working_dir: /var/www
    volumes:
      - ./app:/var/www
      - ./php/local.ini:/usr/local/etc/php/conf.d/local.ini
    networks:
      - app-network

In nginx.conf it is connected like this:
fastcgi_pass app:9000;
after execution, the docker-compose up -dcontainer with nginx falls, in the logs this is:
app-webserver | 2020/01/08 08:39:02 [emerg] 1#1: host not found in upstream "app" in /etc/nginx/conf.d/nginx.conf:18
app-webserver | nginx: [emerg] host not found in upstream "app" in /etc/nginx/conf.d/nginx.conf:18

what am i doing wrong?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
1
1001001, 2020-01-08
@colonel

networks:
      testing_net:
        ipv4_address: 172.28.1.3

Webserver on a different network, like the base

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question