1 year ago

#352347

test-img

Satheez

Error: [Errno 99] Cannot assign requested address: file: /usr/lib/python2.7/socket.py line: 575

I'm trying to implement Laravel supervisor schedule job via docker. But receiving the following error message when I try to access supervisor on terminal

error: <class 'socket.error'>, [Errno 99] Cannot assign requested address: file: /usr/lib/python2.7/socket.py line: 575

docker-compose.yml

version: '3'
services:

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

  #Nginx Service
  webserver:
    image: nginx:alpine
    container_name: messaing_webserver_template
    restart: unless-stopped
    tty: true
    ports:
      - "90:80"
      - "444:443"
    volumes:
      - ./:/var/www
      - ./nginx/conf.d/:/etc/nginx/conf.d/
    networks:
      - app-network


#Docker Networks
networks:
  app-network:
    driver: bridge
  #Volumes
volumes:
  lbdata:
    driver: local

Dockerfile

          FROM php:8.0-fpm

      # Install dependencies
      # ---------------------------------------------------------
      RUN apt-get update && apt-get install -y \
          build-essential \
          libfreetype6-dev \
          locales \
          zip \
          unzip \
          wget \
          vim \
          cron \
          git \
          supervisor \
          curl \
          libcurl4-openssl-dev \
          pkg-config \
          libssl-dev --fix-missing

      RUN apt-get update -y

      # install composer
      RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
      RUN composer self-update

      RUN apt-get clean && rm -rf /var/lib/apt/lists/*

      # ---------------------------------------------------------
      RUN docker-php-ext-install pdo_mysql exif pcntl
      RUN docker-php-ext-install sockets
      RUN docker-php-ext-enable sockets
      #RUN docker-php-ext-install pdo_mysql mbstring zip exif pcntl
      #RUN docker-php-ext-configure gd --with-gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ --with-png-dir=/usr/include/
      #RUN docker-php-ext-install gd
      # ---------------------------------------------------------

      # ---------------------------------------------------------
      COPY laravel-crontab /etc/cron.d/laravel-crontab

      RUN chmod 0644 /etc/cron.d/laravel-crontab &&\
          crontab /etc/cron.d/laravel-crontab
      # ---------------------------------------------------------

      # ---------------------------------------------------------
      RUN mkdir -p /var/log/supervisor

      # Copy local supervisord.conf to the conf.d directory
      COPY --chown=root:root supervisord.conf /etc/supervisor/conf.d/supervisord.conf

      # Start supervisord
      CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"]

      #CMD ["/usr/bin/supervisord"]
      # ---------------------------------------------------------

      # ---------------------------------------------------------
      COPY composer.lock composer.json /var/www/
      WORKDIR /var/www

      RUN composer clear-cache
      RUN composer install --no-autoloader --ignore-platform-reqs

      COPY . .

      RUN composer install --ignore-platform-reqs

      RUN chown -R www-data:www-data storage
      # ---------------------------------------------------------

      # ---------------------------------------------------------
      RUN groupadd -g 1000 www
      RUN useradd -u 1000 -ms /bin/bash -g www www
      COPY . /var/www
      COPY --chown=www:www . /var/www
      # ---------------------------------------------------------

      # ---------------------------------------------------------
      WORKDIR /var/www
      # ---------------------------------------------------------

      # ---------------------------------------------------------
      USER www
      # ---------------------------------------------------------

      EXPOSE 9000

      CMD ["php-fpm"]
      # ---------------------------------------------------------

Can anyone suggest a fix the above message?

many thanks in advance.

php

laravel

docker

docker-compose

supervisord

0 Answers

Your Answer

Accepted video resources