How to create a Docker image for PHP and Node?

前端 未结 2 1688
梦毁少年i
梦毁少年i 2021-01-15 08:53

I am trying to create a Cocker container for my Angular that has a PHP file in it. Angular requires npm so I need to have Node.js installed. I don\'t need Apache for my proj

2条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-15 09:02

    I suggest you do it differently. Since php is longer than install, use the php image and install node.

    FROM php:5.6-apache
    
    RUN apt-get update && apt-get install -y node npm
    #WORKDIR is /var/www/html
    COPY . /var/www/html/
    RUN npm install
    

    And then you have apache2 provides .php files.

提交回复
热议问题