phpdockerdocker-composedockerfilefreeradius

Docker "/usr/bin/php" not found in container


I am using docker for my app that includes freeradius,nginx and php. I want to use "program = "/usr/bin/php " this command in container freeradius but it is not working.

In freeradius container I want to run this command "/usr/bin/php" but it says command not found.

Can anyone help me in this ?

version: '3.2'

services:
  freeradius:
    image: "ronakzenexim/2stacks_freeradius:v1"    
    environment:
      - RAD_DEBUG=yes
    depends_on:
      - mysql
      - php
    links:
      - mysql
    restart: always
    networks:
      - backend
  php:
    image: "ronakzenexim/phpfpm72_mycrypt"
    restart: always
    volumes:
        - "./etc/php/php.ini:/usr/local/etc/php/conf.d/php.ini"
        - "./web:/var/www/html"
    networks:
      - backend
 
networks:
  backend:
    ipam:
      config:
        - subnet: 10.0.0.0/24


Solution

  • Create a extension of the freeradius docker image for example

    FROM ronakzenexim/2stacks_freeradius:v1
    # Now install php
    RUN apk update && apk upgrade
    RUN apk add php7 php7-fpm php7-opcache
    
    

    In this container you can run php.