# keep our base image as small as possible FROM nginx/unit:1.13.0-minimal # port used by the listener in config.json EXPOSE 8080 # add PHP language and corresponding language module RUN apt update \ && apt install -y apt-transport-https gnupg1 \ && curl https://nginx.org/keys/nginx_signing.key | apt-key add - \ && echo "deb https://packages.nginx.org/unit/debian/ stretch unit" \ > /etc/apt/sources.list.d/unit.list \ && echo "deb-src https://packages.nginx.org/unit/debian/ stretch unit" \ >> /etc/apt/sources.list.d/unit.list \ && apt update \ && apt install -y unit-php \ # final cleanup && apt remove -y apt-transport-https gnupg1 \ && apt autoremove --purge -y \ && rm -rf /var/lib/apt/lists/* /etc/apt/sources.list.d/*.list # application setup RUN mkdir /www/ && echo '' > /www/index.php \ # prepare the app config for Unit && echo '{ \ "listeners": { \ "*:8080": { \ "pass": "applications/php_app" \ } \ }, \ "applications": { \ "php_app": { \ "type": "php", \ "root": "/www/" \ } \ } \ }' > /docker-entrypoint.d/config.json