Docker compose: Cannot start service nginx: Address already in use

Viewed 389

I try to run nginx service in docker-compose, and get this error. My docker-compose file

version: '3.7'
services:
  nginx:
    image: nginx:alpine
    container_name: nginx
    ports:
      - 80:80
    volumes:
      - ./apps/:/apps
      - ./services/nginx/conf.d/:/etc/nginx/conf.d/
    depends_on:
      - php73
      - php80
    restart: always
    networks:
      mp-network:
        ipv4_address: 192.168.220.10
...

It worked before it... I don't have local nginx or apache2 (port 80 free), and i tried to change port in docker-compose file - result the same. Help please.

1 Answers

I solved this problem. The reason was in ipv4_address: 192.168.220.10 - I had 10 services in ipv4_address: 192.168.220.* ips, and 11th was nginx with hard defined ip, wich was busy

Related