Skip to content

Instantly share code, notes, and snippets.

@samber
Created June 21, 2018 15:50
Show Gist options
  • Save samber/799dbae1d91b6263a160cb4f7e35e076 to your computer and use it in GitHub Desktop.
Save samber/799dbae1d91b6263a160cb4f7e35e076 to your computer and use it in GitHub Desktop.
Laravel Dockerfile for dev
FROM debian:stretch
ENV DEBIAN_FRONTEND="noninteractive" \
INITRD="No" \
PACKAGES="unzip php7.1-fpm php7.1-cli php7.1-common php7.1-curl php7.1-gd php7.1-intl php7.1-pgsql php7.1-mcrypt \
php7.1-json php7.1-redis php7.1-mbstring php7.1-bcmath"
WORKDIR /app
## Installs the PHP runtime and FPM
## also install nodejs needed to generate addresses
RUN echo "*** Installing $PACKAGES" \
&& apt-get update && apt-get install curl gnupg apt-transport-https ca-certificates lsb-release -y -q \
&& curl -o /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg \
&& sh -c 'echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list' \
&& apt-get update && apt-get install -y -q $PACKAGES \
&& curl -sL https://deb.nodesource.com/setup_8.x | bash - \
&& apt-get install nodejs \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
## Install composer
RUN echo "*** Installing composer" \
&& curl -k -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin/ \
&& ln -s /usr/local/bin/composer.phar /usr/local/bin/composer
CMD php artisan serve --host 0.0.0.0 --port 8080 -vvv
@samber
Copy link
Author

samber commented Jun 21, 2018

docker-compose.yml

version: '3'

services:
  app:
    build: .
    ports:
      - "8080:8080"
    volumes:
      - ./:/app

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment