Skip to content

Instantly share code, notes, and snippets.

@shyam-habarakada
Last active August 11, 2019 02:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shyam-habarakada/634307eb10ed1504f3cc3f3a64d4d290 to your computer and use it in GitHub Desktop.
Save shyam-habarakada/634307eb10ed1504f3cc3f3a64d4d290 to your computer and use it in GitHub Desktop.
A docker file for running statamic 2. Adds on GD and Exif dependencies on top of php:7.0-apache
FROM php:7.0-apache
RUN apt-get update \
&& apt-get install -y curl vim \
&& a2enmod rewrite
# Statamic requires GD and Exif
RUN apt-get install -y libfreetype6-dev libjpeg62-turbo-dev libpng-dev
RUN docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/
RUN docker-php-ext-install gd
RUN docker-php-ext-install exif
@shyam-habarakada
Copy link
Author

And the docker-compose.yml I have is copied below. The most important piece in getting this was setting the APP_ENV=dev so I can get debugging turned on properly. Without that, statamic eats the exceptions in a very unhelpful way.

version: '3.0'
services:
  www:
    container_name: the-statamic-web-site
    build:
      context: .
      dockerfile: Dockerfile
    restart: unless-stopped
    stdin_open: true
    tty: true
    volumes:
      - .:/var/www/html:cached
    environment:
      - APP_ENV=dev
    ports:
      - "8888:80"

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