Skip to content

Instantly share code, notes, and snippets.

@63phc
Created August 29, 2016 06:59
Show Gist options
  • Save 63phc/1edd9c19c9501d2f7cb7b0354a0b5067 to your computer and use it in GitHub Desktop.
Save 63phc/1edd9c19c9501d2f7cb7b0354a0b5067 to your computer and use it in GitHub Desktop.
Docker
#!/usr/bin/env bash
php-fpm --allow-to-run-as-root
example.com {
root ./public
fastcgi / php:9000 php
rewrite {
to {path} {path}/ /index.php?{query}
}
}
###########################################################
# MAINTAINER: Aioslike <aioslike@gmail.com> #
###########################################################
# Example Config #----------------------------------
version: "2"
services:
php:
image: "example-image"
container_name: "samplephp"
volumes:
- .:/srv
command: ['bash', 'boot.sh']
caddy:
image: "abiosoft/caddy"
container_name: "samplename"
ports:
- 443:443
- 80:80
volumes:
- ./Caddyfile:/etc/Caddyfile
FROM php:7.0-fpm
RUN apt-get update && \
apt-get install -y libmcrypt-dev \
libpq-dev \
libpng-dev \
libxml2-dev \
libxslt-dev \
libicu-dev \
libjpeg62-turbo-dev \
libfreetype6-dev \
libpng12-dev \
libbz2-dev && \
rm -rf /var/lib/apt/lists/*
RUN docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ && \
docker-php-ext-install \
mcrypt \
bcmath \
mbstring \
zip \
opcache \
pdo \
pdo_mysql \
gd \
xmlrpc \
opcache \
intl \
mysqli \
bz2 \
json
COPY . /srv
WORKDIR /srv
RUN sed -i 's/\r$//' boot.sh
CMD ["/bin/bash", "boot.sh"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment