Skip to content

Instantly share code, notes, and snippets.

@fjahn
Last active October 5, 2021 11:47
Show Gist options
  • Save fjahn/62fdd145b41d2773899db24dec216f01 to your computer and use it in GitHub Desktop.
Save fjahn/62fdd145b41d2773899db24dec216f01 to your computer and use it in GitHub Desktop.
Dockerfile for Statamic
FROM php:8-cli
VOLUME /app
WORKDIR /app
RUN apt update && apt install -y \
tini \
libonig-dev \
&& rm -rf /var/lib/apt/lists/*
# https://gist.github.com/chronon/95911d21928cff786e306c23e7d1d3f3
RUN docker-php-ext-install \
bcmath \
mbstring \
pdo_mysql \
# Enable exif (required for Statamic's Asset Upload)
exif
# Install GD (required for Statamic's Glide)
RUN apt update && apt install -y \
libfreetype6-dev \
libjpeg62-turbo-dev \
libpng-dev \
libwebp-dev \
&& docker-php-ext-configure gd --with-freetype --with-jpeg --with-webp \
&& docker-php-ext-install -j$(nproc) gd
# XDebug
ARG XDEBUG='0'
RUN if [ $XDEBUG -eq 1 ]; then pecl install xdebug && docker-php-ext-enable xdebug; fi
COPY xdebug.ini /usr/local/etc/php/conf.d
COPY error_reporting.ini /usr/local/etc/php/conf.d
EXPOSE 8080
ENTRYPOINT [ "tini", "--", "php" ]
CMD [ "artisan", "serve", "--port", "8080", "--host", "0.0.0.0" ]
error_reporting=E_ALL
zend_extension=xdebug
[xdebug]
; xdebug.mode=develop,debug
xdebug.client_host=host.docker.internal
; xdebug.start_with_request=yes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment