Use composer image in a docker-compose.yaml

0

I want to make an image to install a project in laravel. All this just for the measure of learning.

My point is, I want to run the composer install command in the bash of the container.

This is my Dockerfile

FROM php:5.6
WORKDIR /app
ADD ./composer.json /app
  

I start from an image of php 5.6 because I already have php 7 in my machine and I want to see the operation with a php that does not have installed in my machine

This is my docker-compose.yaml

version: '2'
services:
  composer:
    image: "composer"
    volumes:
      - .:/app
  web:
    build: .
    ports:
      - "8080:80"
  

IMPORTANT POINT : I want to use composer from docker-compose and not from Dokerfile. I know I can run the RUN and install it with the documentation commands, but my goal is to use it with docker-compose .

    
asked by Franklin'j Gil'z 28.08.2018 в 04:26
source

0 answers