Hello I am creating a dockerfile for my laravel project. This is it so far:
FROM php:7.2-cli
FROM nginx
FROM node:8
MAINTAINER zachary tyhacz
# does not install mysql
# mysql is outside container
RUN apt-get update -y && apt-get install -y openssl zip unzip git
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
WORKDIR /var/www/public
COPY . /var/www/public
COPY nginx.conf /etc/nginx/sites-available/domain
RUN ln -s /etc/nginx/sites-available /etc/nginx/sites-enabled
RUN npm install
RUN composer install
# sets up the database
CMD php artisan migrate:fresh --seed
# resets configuration files
CMD php artisan config:cache
# refreshes routes
CMD php artisan route:cache
# enables serve
CMD php artisan serve --host=0.0.0.0 --port=436
EXPOSE 8080/udp
EXPOSE 8080/tcp
EXPOSE 80/udp
EXPOSE 80/tcp
EXPOSE 436/tcp
EXPOSE 436/udp
upon docker tag to create an image, it gets to this instruction:
Step 6/22 : RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
and it throws this error and stops.
/bin/sh: 1: php: not found
curl: (23) Failed writing body (0 != 16133)
I am not sure what is going wrong. I think it could be a permissions issue or a directory issue.
Thanks anyone for any suggestions in helping me out
also, my reference in helping me create this dockerfile is this: https://buddy.works/guides/laravel-in-docker