title: How to add php-redis for a dockerfile of laravel to kubernetes?
body: <p>I'm setting a deploy of  laravel to kubernetes and want to have redis.</p>
  
  <p>Actually i have a Dockerfile for nginx and another one for php-fpm-alpine and all the kubernetes yaml files(the ingress with tls, deployments and services)</p>
  
  <h3>I expected to add the php redis to the php-fpm container, any ideas?</h3>
  
  <p>here the actual php /Dockerfile</p>
  
  <pre><code>#
  # PHP Dependencies
  #
  FROM composer:1 as vendor
  
  COPY database/ database/
  COPY composer.json composer.json
  COPY composer.lock composer.lock
  
  RUN composer install \
      --ignore-platform-reqs \
      --no-interaction \
      --no-plugins \
      --no-scripts \
      --prefer-dist
  
  #
  # Application
  #
  FROM php:fpm-alpine
  RUN apk add --no-cache --virtual .build-deps \
          $PHPIZE_DEPS \
          curl \
          libtool \
          libxml2-dev \
      &amp;&amp; apk add --no-cache \
          curl \
          git \
          mysql-client \
      &amp;&amp; docker-php-ext-install \
          mbstring \
          pdo \
          pdo_mysql \
          tokenizer \
          bcmath \
          opcache \
          xml \
      &amp;&amp; apk del -f .build-deps \
      &amp;&amp; docker-php-ext-enable pdo_mysql
  
  WORKDIR /var/www/html
  
  COPY . /var/www/html
  COPY --from=vendor /app/vendor/ /var/www/html/vendor/
  COPY .env.example /var/www/html/.env
  
  RUN chown -R root:www-data . 
  
  EXPOSE 9000
  
  CMD ["php-fpm"]
  </code></pre>
  
  <p>and the nginx /Dockerfile</p>
  
  <pre><code>FROM nginx:stable-alpine
  
  ADD default.conf /etc/nginx/conf.d/default.conf
  
  COPY public /var/www/html/public
  WORKDIR /var/www/html/public
  </code></pre>
  
  <p>finally the nginx default /conf.d</p>
  
  <pre><code>server {
      listen 80;
  
      index index.php index.html;
      root /var/www/html/public;
  
      client_max_body_size 32M;
  
      location / {
          try_files $uri /index.php?$args;
      }
  
      location ~ \.php$ {
      fastcgi_pass   php:9000;
      fastcgi_index  index.php;
      fastcgi_param  SCRIPT_FILENAME $document_root$fastcgi_script_name;
      include        fastcgi_params;
      }
  }
  </code></pre>