I
I
Igor2019-09-08 19:51:13
Docker
Igor, 2019-09-08 19:51:13

How to deal with ip addresses in docker?

Good evening!
The problem is the following.
Configured a Docker-compose project Deployed
on linux without problems
And partially deployed on Windows in linux container
An error occurs

ERROR: for nuxt-admin  Cannot start service nuxt-admin: driver failed programming external connectivity on endpoint gorodbrand.nuxt_admin (befaf75846592991f16ce72c043e6cab5d1e3bbd66ee93e0d92b5a15aec248ac): Error starting userland proxy: listen tcp 0.0.0.0:3100: bind: An attempt was made to access a socket in a way forbidden by its access permissions.
ERROR: Encountered errors while bringing up the project.

docker compose
# https://phptoday.ru/post/gotovim-lokalnuyu-sredu-docker-dlya-razrabotki-na-php
version: "3.1"

services:

  # Php application
  app:
    container_name: gorodbrand.app
    restart: on-failure
    build: .
    volumes:
      - .:/var/www
      - ./docker/php/log:/var/log
    depends_on:
      - db


  # Database
  db:
    image: percona
    container_name: gorodbrand.db
    restart: always
    volumes:
      - ./docker/mysql/.db:/var/lib/mysql
      - ./docker/mysql/log:/var/log/mysql
      - ./docker/mysql/conf.d:/etc/mysql/conf.d
    ports:
      - 3340:3306
    expose:
      - 3306


  # Nginx api server
  nginx-api:
    image: nginx:latest
    container_name: gorodbrand.nginx-api
    restart: always
    build: ./docker/nginx
    volumes:
      - ./docker/nginx/nginx.conf:/etc/nginx/nginx.conf
      - ./docker/nginx/sites-enabled/vhost-api.gorodbrand.conf:/etc/nginx/sites-enabled/vhost-api.gorodbrand.conf
      - ./docker/nginx/logs:/var/log/nginx
    ports:
      - "8090:80"
    depends_on:
      - app
    expose:
      - 80
    command: ["nginx", "-g", "daemon off;"]


  # Nginx admin server
  nginx-admin:
    image: nginx:latest
    container_name: gorodbrand.nginx-admin
    restart: always
    volumes:
      - ./docker/nginx/nginx.conf:/etc/nginx/nginx.conf
      - ./docker/nginx/sites-enabled/vhost-api.gorodbrand.conf:/etc/nginx/sites-enabled/vhost-admin.gorodbrand.conf
      - ./docker/nginx/logs:/var/log/nginx
    ports:
      - "8091:80"
    depends_on:
        - app
    expose:
        - 80
    command: ["nginx", "-g", "daemon off;"]


  # Nuxt administrator
  nuxt-admin:
    container_name: gorodbrand.nuxt_admin
    restart: always
    build: ./nuxt_admin
    ports:
      - 3100:3000
    expose:
      - 3000


  # Nuxt publication
  nuxt-public:
    container_name: gorodbrand.nuxt_public
    restart: always
    build: ./nuxt_public
    ports:
      - 3200:3000
    expose:
      - 3000

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Derepko, 2019-09-08
@xEpozZ

try to raise the container as admin

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question