docker-php-nginx/Dockerfile

32 lines
892 B
Docker

FROM php:7.0-fpm
# Install Nginx
ENV NGINX_VERSION 1.9.11-1~jessie
RUN apt-key adv --keyserver hkp://pgp.mit.edu:80 --recv-keys 573BFD6B3D8FBC641079A6ABABF5BD827BD9BF62 \
&& echo "deb http://nginx.org/packages/mainline/debian/ jessie nginx" >> /etc/apt/sources.list \
&& apt-get update \
&& apt-get install -y ca-certificates nginx=${NGINX_VERSION} gettext-base \
&& rm -rf /var/lib/apt/lists/*
# Install supervisor
RUN apt-get update && apt-get install -y supervisor
# Configure nginx
RUN rm /etc/nginx/conf.d/default.conf
COPY config/nginx.conf /etc/nginx/conf.d/nginx.conf
# Configure supervisor
COPY config/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
# Configure PHP-FPM
COPY config/php.ini /usr/local/etc/php/conf.d/custom.ini
# Add application
RUN mkdir -p /var/www/html
WORKDIR /var/www/html
COPY src/ /var/www/html/
EXPOSE 80 443
CMD ["/usr/bin/supervisord"]