[
  {
    "path": ".dockerignore",
    "content": ".git\n.github\n.gitignore\n.editorconfig\ndocker-compose.yml\nREADME.md\n"
  },
  {
    "path": ".editorconfig",
    "content": "; http://editorconfig.org\n;\n; Sublime: https://github.com/sindresorhus/editorconfig-sublime\n; Phpstorm: https://plugins.jetbrains.com/plugin/7294-editorconfig\n\nroot = true\n\n[*]\nindent_style = space\nindent_size = 2\nend_of_line = lf\ncharset = utf-8\ntrim_trailing_whitespace = true\ninsert_final_newline = true\n\n[{*.md,*.php}]\nindent_size = 4\n"
  },
  {
    "path": ".github/FUNDING.yml",
    "content": "github: adhocore\ncustom: ['https://paypal.me/ji10']\n"
  },
  {
    "path": ".github/workflows/build.yml",
    "content": "name: build\n\non:\n  workflow_dispatch:\n  push:\n    branches:\n      - 'main'\n\njobs:\n  docker:\n    runs-on: ubuntu-latest\n    steps:\n      - name: Checkout\n        uses: actions/checkout@v4\n      - name: Set up QEMU\n        uses: docker/setup-qemu-action@v2\n      - name: Set up Docker Buildx\n        uses: docker/setup-buildx-action@v2\n      - name: Login to DockerHub\n        uses: docker/login-action@v2\n        with:\n          username: ${{ secrets.DOCKERHUB_USERNAME }}\n          password: ${{ secrets.DOCKERHUB_TOKEN }}\n      - name: \"Docker Pull\"\n        run: |\n          docker pull adhocore/phpfpm:8.0 || true\n          docker pull adhocore/phpfpm:8.1 || true\n          docker pull adhocore/phpfpm:8.2 || true\n          docker pull adhocore/phpfpm:8.3 || true\n\n      - name: \"[8.3] Build and push\"\n        id: docker_build_83\n        uses: docker/build-push-action@v4\n        with:\n          push: true\n          file: 8.3.Dockerfile\n          tags: adhocore/lemp:8.3,adhocore/lemp:latest\n          platforms: linux/amd64,linux/arm64\n      - name: \"[8.2] Build and push\"\n        id: docker_build_82\n        uses: docker/build-push-action@v4\n        with:\n          push: true\n          file: 8.2.Dockerfile\n          tags: adhocore/lemp:8.2\n          platforms: linux/amd64,linux/arm64\n      - name: \"[8.1] Build and push\"\n        id: docker_build_81\n        uses: docker/build-push-action@v4\n        with:\n          push: true\n          file: 8.1.Dockerfile\n          tags: adhocore/lemp:8.1\n          platforms: linux/amd64,linux/arm64\n      - name: \"[8.0] Build and push\"\n        id: docker_build_80\n        uses: docker/build-push-action@v4\n        with:\n          push: true\n          file: 8.0.Dockerfile\n          tags: adhocore/lemp:8.0\n          platforms: linux/amd64,linux/arm64\n\n      - name: \"[8.3] Test\"\n        run: |\n          docker run --name lemp83 adhocore/lemp:8.3 &\n          sleep 60\n          docker exec $(docker ps -q -f 'name=lemp83') netstat -ant | grep -E '0:11300|0:11211|1:9300|1:9200|::9000|0:6379|1:5432|0:3306|0:88|0:25'\n          PORTS=$(docker exec $(docker ps -q -f 'name=lemp83') netstat -ant | grep -E '0:11300|0:11211|1:9300|1:9200|::9000|0:6379|1:5432|0:3306|0:88|0:25' | wc -l | xargs)\n          sleep 1 && docker stop lemp83 > /dev/null || true\n          [[ \"10\" == \"$PORTS\" ]] || { echo '[8.3] Not all ports are open' && exit 1; }\n      - name: \"[8.2] Test\"\n        run: |\n          docker run --name lemp82 adhocore/lemp:8.2 &\n          sleep 60\n          docker exec $(docker ps -q -f 'name=lemp82') netstat -ant | grep -E '0:11300|0:11211|1:9300|1:9200|::9000|0:6379|1:5432|0:3306|0:88|0:80|0:25'\n          PORTS=$(docker exec $(docker ps -q -f 'name=lemp82') netstat -ant | grep -E '0:11300|0:11211|1:9300|1:9200|::9000|0:6379|1:5432|0:3306|0:88|0:80|0:25' | wc -l | xargs)\n          sleep 1 && docker stop lemp82 > /dev/null || true\n          [[ \"11\" == \"$PORTS\" ]] || { echo '[8.2] Not all ports are open' && exit 1; }\n      - name: \"[8.1] Test\"\n        run: |\n          docker run --name lemp81 adhocore/lemp:8.1 &\n          sleep 60\n          docker exec $(docker ps -q -f 'name=lemp81') netstat -ant | grep -E '0:11300|0:11211|1:9300|1:9200|::9000|0:6379|1:5432|0:3306|0:88|0:80|0:25'\n          PORTS=$(docker exec $(docker ps -q -f 'name=lemp81') netstat -ant | grep -E '0:11300|0:11211|1:9300|1:9200|::9000|0:6379|1:5432|0:3306|0:88|0:80|0:25' | wc -l | xargs)\n          sleep 1 && docker stop lemp81 > /dev/null || true\n          [[ \"11\" == \"$PORTS\" ]] || { echo '[8.1] Not all ports are open' && exit 1; }\n      - name: \"[8.0] Test\"\n        run: |\n          docker run --name lemp80 adhocore/lemp:8.0 &\n          sleep 60\n          docker exec $(docker ps -q -f 'name=lemp80') netstat -ant | grep -E '0:11300|0:11211|1:9300|1:9200|::9000|0:6379|1:5432|0:3306|0:88|0:80|0:25'\n          PORTS=$(docker exec $(docker ps -q -f 'name=lemp80') netstat -ant | grep -E '0:11300|0:11211|1:9300|1:9200|::9000|0:6379|1:5432|0:3306|0:88|0:80|0:25' | wc -l | xargs)\n          sleep 1 && docker stop lemp80 > /dev/null || true\n          [[ \"11\" == \"$PORTS\" ]] || { echo '[8.0] Not all ports are open' && exit 1; }\n\n"
  },
  {
    "path": ".github/workflows/build_manual.yml",
    "content": "name: build_manual\n\non:\n  workflow_dispatch:\n\njobs:\n  docker:\n    runs-on: ubuntu-latest\n    steps:\n      - name: Checkout\n        uses: actions/checkout@v3\n      - name: Set up QEMU\n        uses: docker/setup-qemu-action@v2\n      - name: Set up Docker Buildx\n        uses: docker/setup-buildx-action@v2\n      - name: Login to DockerHub\n        uses: docker/login-action@v2\n        with:\n          username: ${{ secrets.DOCKERHUB_USERNAME }}\n          password: ${{ secrets.DOCKERHUB_TOKEN }}\n      - name: \"Docker Pull\"\n        run: |\n          docker pull adhocore/phpfpm:7.4 || true\n      - name: \"[7.4] Build and push\"\n        id: docker_build_74\n        uses: docker/build-push-action@v4\n        with:\n          push: true\n          file: 7.4.Dockerfile\n          tags: adhocore/lemp:7.4\n          platforms: linux/amd64,linux/arm64\n      - name: \"[7.4] Test\"\n        run: |\n          docker run --name lemp74 adhocore/lemp:7.4 &\n          sleep 60\n          docker exec $(docker ps -q -f 'name=lemp74') netstat -ant | grep -E '0:11300|0:11211|1:9300|1:9200|::9000|0:6379|1:5432|0:3306|0:88|0:74|0:25'\n          PORTS=$(docker exec $(docker ps -q -f 'name=lemp74') netstat -ant | grep -E '0:11300|0:11211|1:9300|1:9200|::9000|0:6379|1:5432|0:3306|0:88|0:74|0:25' | wc -l | xargs)\n          sleep 1 && docker stop lemp74 > /dev/null || true\n          [[ \"11\" == \"$PORTS\" ]] || { echo '[7.4] Not all ports are open' && exit 1; }\n\n"
  },
  {
    "path": ".github/workflows/build_preview.yml",
    "content": "name: build_preview\n\non:\n  workflow_dispatch:\n\njobs:\n  docker:\n    runs-on: ubuntu-latest\n    steps:\n      - name: Checkout\n        uses: actions/checkout@v3\n      - name: Set up QEMU\n        uses: docker/setup-qemu-action@v2\n      - name: Set up Docker Buildx\n        uses: docker/setup-buildx-action@v2\n      - name: Login to DockerHub\n        uses: docker/login-action@v2\n        with:\n          username: ${{ secrets.DOCKERHUB_USERNAME }}\n          password: ${{ secrets.DOCKERHUB_TOKEN }}\n      - name: \"Docker Pull\"\n        run: |\n          docker pull adhocore/phpfpm:7.4 || true\n      - name: \"[8.3] Build and push\"\n        id: docker_build_83\n        uses: docker/build-push-action@v4\n        with:\n          push: true\n          file: 8.3.Dockerfile\n          tags: adhocore/lemp:8.3b\n          platforms: linux/amd64,linux/arm64\n      - name: \"[8.3] Test\"\n        run: |\n          docker run --name lemp83 adhocore/lemp:8.3b &\n          sleep 60\n          docker exec $(docker ps -q -f 'name=lemp83') netstat -ant | grep -E '0:11300|0:11211|1:9300|1:9200|::9000|0:6379|1:5432|0:3306|0:88|0:25'\n          PORTS=$(docker exec $(docker ps -q -f 'name=lemp83') netstat -ant | grep -E '0:11300|0:11211|1:9300|1:9200|::9000|0:6379|1:5432|0:3306|0:88|0:25' | wc -l | xargs)\n          sleep 1 && docker stop lemp83 > /dev/null || true\n          [[ \"10\" == \"$PORTS\" ]] || { echo '[8.3] Not all ports are open' && exit 1; }\n"
  },
  {
    "path": ".gitignore",
    "content": "docker-compose.yml\ndocker-project.json\n"
  },
  {
    "path": "7.4.Dockerfile",
    "content": "FROM adhocore/phpfpm:7.4\n\nMAINTAINER Jitendra Adhikari <jiten.adhikary@gmail.com>\n\nENV \\\n  ADMINEREVO_VERSION=4.8.4 \\\n  ES_HOME=/usr/share/java/elasticsearch \\\n  PATH=/usr/share/java/elasticsearch/bin:$PATH\n\nRUN \\\n  # prepare\n  echo @legacy https://dl-cdn.alpinelinux.org/alpine/v3.12/community >> /etc/apk/repositories \\\n  # install\n  && apk add -U --no-cache \\\n    beanstalkd \\\n    elasticsearch@legacy \\\n    memcached \\\n    mysql mysql-client \\\n    nano \\\n    nginx \\\n    postgresql \\\n    redis \\\n    supervisor \\\n  # elastic setup\n  && rm -rf $ES_HOME/plugins \\\n    && mkdir -p $ES_HOME/tmp $ES_HOME/data $ES_HOME/logs $ES_HOME/plugins $ES_HOME/config/scripts \\\n      && mv /etc/elasticsearch/* $ES_HOME/config/ \\\n    # elastico user\n    && deluser elastico && addgroup -S elastico \\\n      && adduser -D -S -h /usr/share/java/elasticsearch -s /bin/ash -G elastico elastico \\\n      && chown elastico:elastico -R $ES_HOME \\\n      && { sed -ie \"s/^-XX:/8-13:-XX:/\" /usr/share/java/elasticsearch/config/jvm.options || true; } \\\n  # rabbitmq\n  # && echo @testing http://nl.alpinelinux.org/alpine/edge/testing >> /etc/apk/repositories \\\n    # && apk add -U rabbitmq-server@testing \\\n    # && apk add -U rabbitmq-server \\\n  # adminerevo\n  && mkdir -p /var/www/adminerevo \\\n    && curl -sSLo /var/www/adminerevo/index.php \\\n      \"https://github.com/adminerevo/adminerevo/releases/download/v$ADMINEREVO_VERSION/adminer-$ADMINEREVO_VERSION.php\" \\\n  # cleanup\n  && rm -rf /var/cache/apk/* /tmp/* /var/tmp/* /usr/share/doc/* /usr/share/man/*\n\n# nginx config\nCOPY nginx/nginx.conf /etc/nginx/nginx.conf\nCOPY nginx/conf.d/default.conf /etc/nginx/conf.d/default.conf\n\n# mailcatcher\nCOPY --from=tophfr/mailcatcher /usr/lib/libruby.so.2.5 /usr/lib/libruby.so.2.5\nCOPY --from=tophfr/mailcatcher /usr/lib/ruby/ /usr/lib/ruby/\nCOPY --from=tophfr/mailcatcher /usr/bin/ruby /usr/bin/mailcatcher /usr/bin/\n\n# resource\nCOPY php/index.php /var/www/html/index.php\n\n# supervisor config\nCOPY \\\n  beanstalkd/beanstalkd.ini \\\n  elasticsearch/elasticsearch.ini \\\n  mailcatcher/mailcatcher.ini \\\n  memcached/memcached.ini \\\n  mysql/mysql.ini \\\n  nginx/nginx.ini \\\n  pgsql/pgsql.ini \\\n  php/php-fpm.ini \\\n  # rabbitmq/rabbitmq.ini \\\n  redis/redis.ini \\\n    /etc/supervisor.d/\n\n# entrypoint\nCOPY docker-entrypoint.sh /docker-entrypoint.sh\nRUN chmod +x /docker-entrypoint.sh\n\n# ports\nEXPOSE 11300 11211 9300 9200 9000 6379 5432 3306 88 80 25\n\n# commands\nENTRYPOINT [\"/docker-entrypoint.sh\"]\nCMD [\"supervisord\", \"-n\", \"-j\", \"/supervisord.pid\"]\n"
  },
  {
    "path": "8.0.Dockerfile",
    "content": "FROM adhocore/phpfpm:8.0\n\nMAINTAINER Jitendra Adhikari <jiten.adhikary@gmail.com>\n\nENV \\\n  ADMINEREVO_VERSION=4.8.4 \\\n  ES_HOME=/usr/share/java/elasticsearch \\\n  PATH=/usr/share/java/elasticsearch/bin:$PATH\n\nRUN \\\n  # prepare\n  echo @legacy https://dl-cdn.alpinelinux.org/alpine/v3.12/community >> /etc/apk/repositories \\\n  # install\n  && apk add -U --no-cache \\\n    beanstalkd \\\n    elasticsearch@legacy \\\n    memcached \\\n    mysql mysql-client \\\n    nano \\\n    nginx \\\n    postgresql \\\n    redis \\\n    supervisor \\\n    poppler-utils \\\n  # elastic setup\n  && rm -rf $ES_HOME/plugins \\\n    && mkdir -p $ES_HOME/tmp $ES_HOME/data $ES_HOME/logs $ES_HOME/plugins $ES_HOME/config/scripts \\\n      && mv /etc/elasticsearch/* $ES_HOME/config/ \\\n    # elastico user\n    && deluser elastico && addgroup -S elastico \\\n      && adduser -D -S -h /usr/share/java/elasticsearch -s /bin/ash -G elastico elastico \\\n      && chown elastico:elastico -R $ES_HOME \\\n      && { sed -ie \"s/^-XX:/8-13:-XX:/\" /usr/share/java/elasticsearch/config/jvm.options || true; } \\\n  # rabbitmq\n  # && echo @testing http://nl.alpinelinux.org/alpine/edge/testing >> /etc/apk/repositories \\\n    # && apk add -U rabbitmq-server@testing \\\n    # && apk add -U rabbitmq-server \\\n  # adminerevo\n  && mkdir -p /var/www/adminerevo \\\n    && curl -sSLo /var/www/adminerevo/index.php \\\n      \"https://github.com/adminerevo/adminerevo/releases/download/v$ADMINEREVO_VERSION/adminer-$ADMINEREVO_VERSION.php\" \\\n  # cleanup\n  && rm -rf /var/cache/apk/* /tmp/* /var/tmp/* /usr/share/doc/* /usr/share/man/*\n\n# nginx config\nCOPY nginx/nginx.conf /etc/nginx/nginx.conf\nCOPY nginx/conf.d/default.conf /etc/nginx/conf.d/default.conf\n\n# mailcatcher\nCOPY --from=tophfr/mailcatcher /usr/lib/libruby.so.2.5 /usr/lib/libruby.so.2.5\nCOPY --from=tophfr/mailcatcher /usr/lib/ruby/ /usr/lib/ruby/\nCOPY --from=tophfr/mailcatcher /usr/bin/ruby /usr/bin/mailcatcher /usr/bin/\n\n# resource\nCOPY php/index.php /var/www/html/index.php\n\n# supervisor config\nCOPY \\\n  beanstalkd/beanstalkd.ini \\\n  elasticsearch/elasticsearch.ini \\\n  mailcatcher/mailcatcher.ini \\\n  memcached/memcached.ini \\\n  mysql/mysql.ini \\\n  nginx/nginx.ini \\\n  pgsql/pgsql.ini \\\n  php/php-fpm.ini \\\n  # rabbitmq/rabbitmq.ini \\\n  redis/redis.ini \\\n    /etc/supervisor.d/\n\n# entrypoint\nCOPY docker-entrypoint.sh /docker-entrypoint.sh\nRUN chmod +x /docker-entrypoint.sh\n\n# ports\nEXPOSE 11300 11211 9300 9200 9000 6379 5432 3306 88 80 25\n\n# commands\nENTRYPOINT [\"/docker-entrypoint.sh\"]\nCMD [\"supervisord\", \"-n\", \"-j\", \"/supervisord.pid\"]\n"
  },
  {
    "path": "8.1.Dockerfile",
    "content": "FROM adhocore/phpfpm:8.1\n\nMAINTAINER Jitendra Adhikari <jiten.adhikary@gmail.com>\n\nENV \\\n  ADMINEREVO_VERSION=4.8.4 \\\n  ES_HOME=/usr/share/java/elasticsearch \\\n  PATH=/usr/share/java/elasticsearch/bin:$PATH\n\nRUN \\\n  # prepare\n  echo @legacy https://dl-cdn.alpinelinux.org/alpine/v3.12/community >> /etc/apk/repositories \\\n  # install\n  && apk add -U --no-cache libssl1.1 \\\n    beanstalkd \\\n    elasticsearch@legacy \\\n    memcached \\\n    mysql mysql-client \\\n    nano \\\n    nginx \\\n    postgresql \\\n    # rabbitmq-server@testing \\\n    redis \\\n    supervisor \\\n    poppler-utils \\\n  # elastic setup\n  && rm -rf $ES_HOME/plugins \\\n    && mkdir -p $ES_HOME/tmp $ES_HOME/data $ES_HOME/logs $ES_HOME/plugins $ES_HOME/config/scripts \\\n      && mv /etc/elasticsearch/* $ES_HOME/config/ \\\n    # elastico user\n    && deluser elastico && addgroup -S elastico \\\n      && adduser -D -S -h /usr/share/java/elasticsearch -s /bin/ash -G elastico elastico \\\n      && chown elastico:elastico -R $ES_HOME \\\n      && { sed -ie \"s/^-XX:/8-13:-XX:/\" /usr/share/java/elasticsearch/config/jvm.options || true; } \\\n  # rabbitmq\n  # && apk add -U rabbitmq-server@testing \\\n    # && apk add -U rabbitmq-server \\\n  # adminerevo\n  && mkdir -p /var/www/adminerevo \\\n    && curl -sSLo /var/www/adminerevo/index.php \\\n      \"https://github.com/adminerevo/adminerevo/releases/download/v$ADMINEREVO_VERSION/adminer-$ADMINEREVO_VERSION.php\" \\\n  # cleanup\n  && rm -rf /var/cache/apk/* /tmp/* /var/tmp/* /usr/share/doc/* /usr/share/man/*\n\n# nginx config\nCOPY nginx/nginx.conf /etc/nginx/nginx.conf\nCOPY nginx/conf.d/default.conf /etc/nginx/conf.d/default.conf\n\n# mailcatcher\nCOPY --from=tophfr/mailcatcher /usr/lib/libruby.so.2.5 /usr/lib/libruby.so.2.5\nCOPY --from=tophfr/mailcatcher /usr/lib/ruby/ /usr/lib/ruby/\nCOPY --from=tophfr/mailcatcher /usr/bin/ruby /usr/bin/mailcatcher /usr/bin/\n\n# resource\nCOPY php/index.php /var/www/html/index.php\n\n# supervisor config\nCOPY \\\n  beanstalkd/beanstalkd.ini \\\n  elasticsearch/elasticsearch.ini \\\n  mailcatcher/mailcatcher.ini \\\n  memcached/memcached.ini \\\n  mysql/mysql.ini \\\n  nginx/nginx.ini \\\n  pgsql/pgsql.ini \\\n  php/php-fpm.ini \\\n  # rabbitmq/rabbitmq.ini \\\n  redis/redis.ini \\\n    /etc/supervisor.d/\n\n# entrypoint\nCOPY docker-entrypoint.sh /docker-entrypoint.sh\nRUN chmod +x /docker-entrypoint.sh\n\n# ports\nEXPOSE 11300 11211 9300 9200 9000 6379 5432 3306 88 80 25\n\n# commands\nENTRYPOINT [\"/docker-entrypoint.sh\"]\nCMD [\"supervisord\", \"-n\", \"-j\", \"/supervisord.pid\"]\n"
  },
  {
    "path": "8.2.Dockerfile",
    "content": "FROM adhocore/phpfpm:8.2\n\nMAINTAINER Jitendra Adhikari <jiten.adhikary@gmail.com>\n\nENV \\\n  ADMINEREVO_VERSION=4.8.4 \\\n  ES_HOME=/usr/share/java/elasticsearch \\\n  PATH=/usr/share/java/elasticsearch/bin:$PATH\n\nRUN \\\n  # prepare\n  echo @legacy https://dl-cdn.alpinelinux.org/alpine/v3.12/community >> /etc/apk/repositories \\\n  # install\n  && apk add -U --no-cache libssl1.1 \\\n    beanstalkd \\\n    elasticsearch@legacy \\\n    memcached \\\n    mysql mysql-client \\\n    nano \\\n    nginx \\\n    postgresql \\\n    # rabbitmq-server@testing \\\n    redis \\\n    supervisor \\\n    poppler-utils \\\n  # elastic setup\n  && rm -rf $ES_HOME/plugins \\\n    && mkdir -p $ES_HOME/tmp $ES_HOME/data $ES_HOME/logs $ES_HOME/plugins $ES_HOME/config/scripts \\\n      && mv /etc/elasticsearch/* $ES_HOME/config/ \\\n    # elastico user\n    && deluser elastico && addgroup -S elastico \\\n      && adduser -D -S -h /usr/share/java/elasticsearch -s /bin/ash -G elastico elastico \\\n      && chown elastico:elastico -R $ES_HOME \\\n      && { sed -ie \"s/^-XX:/8-13:-XX:/\" /usr/share/java/elasticsearch/config/jvm.options || true; } \\\n  # rabbitmq\n  # && apk add -U rabbitmq-server@testing \\\n    # && apk add -U rabbitmq-server \\\n  # adminerevo\n  && mkdir -p /var/www/adminerevo \\\n    && curl -sSLo /var/www/adminerevo/index.php \\\n      \"https://github.com/adminerevo/adminerevo/releases/download/v$ADMINEREVO_VERSION/adminer-$ADMINEREVO_VERSION.php\" \\\n  # cleanup\n  && rm -rf /var/cache/apk/* /tmp/* /var/tmp/* /usr/share/doc/* /usr/share/man/*\n\n# nginx config\nCOPY nginx/nginx.conf /etc/nginx/nginx.conf\nCOPY nginx/conf.d/default.conf /etc/nginx/conf.d/default.conf\n\n# mailcatcher\nCOPY --from=tophfr/mailcatcher /usr/lib/libruby.so.2.5 /usr/lib/libruby.so.2.5\nCOPY --from=tophfr/mailcatcher /usr/lib/ruby/ /usr/lib/ruby/\nCOPY --from=tophfr/mailcatcher /usr/bin/ruby /usr/bin/mailcatcher /usr/bin/\n\n# resource\nCOPY php/index.php /var/www/html/index.php\n\n# supervisor config\nCOPY \\\n  beanstalkd/beanstalkd.ini \\\n  elasticsearch/elasticsearch.ini \\\n  mailcatcher/mailcatcher.ini \\\n  memcached/memcached.ini \\\n  mysql/mysql.ini \\\n  nginx/nginx.ini \\\n  pgsql/pgsql.ini \\\n  php/php-fpm.ini \\\n  # rabbitmq/rabbitmq.ini \\\n  redis/redis.ini \\\n    /etc/supervisor.d/\n\n# entrypoint\nCOPY docker-entrypoint.sh /docker-entrypoint.sh\nRUN chmod +x /docker-entrypoint.sh\n\n# ports\nEXPOSE 11300 11211 9300 9200 9000 6379 5432 3306 88 80 25\n\n# commands\nENTRYPOINT [\"/docker-entrypoint.sh\"]\nCMD [\"supervisord\", \"-n\", \"-j\", \"/supervisord.pid\"]\n"
  },
  {
    "path": "8.3.Dockerfile",
    "content": "FROM adhocore/phpfpm:8.3a\n\nMAINTAINER Jitendra Adhikari <jiten.adhikary@gmail.com>\n\nENV \\\n  ADMINEREVO_VERSION=4.8.4 \\\n  ES_HOME=/usr/share/java/elasticsearch \\\n  PATH=/usr/share/java/elasticsearch/bin:$PATH\n\nRUN \\\n  # prepare\n  echo @legacy https://dl-cdn.alpinelinux.org/alpine/v3.12/community >> /etc/apk/repositories \\\n  # install\n  && apk add -U --no-cache libssl1.1 \\\n    beanstalkd \\\n    elasticsearch@legacy \\\n    memcached \\\n    mysql mysql-client \\\n    nano \\\n    nginx \\\n    postgresql \\\n    # rabbitmq-server@testing \\\n    redis \\\n    supervisor \\\n  # elastic setup\n  && rm -rf $ES_HOME/plugins \\\n    && mkdir -p $ES_HOME/tmp $ES_HOME/data $ES_HOME/logs $ES_HOME/plugins $ES_HOME/config/scripts \\\n      && mv /etc/elasticsearch/* $ES_HOME/config/ \\\n    # elastico user\n    && deluser elastico && addgroup -S elastico \\\n      && adduser -D -S -h /usr/share/java/elasticsearch -s /bin/ash -G elastico elastico \\\n      && chown elastico:elastico -R $ES_HOME \\\n      && { sed -ie \"s/^-XX:/8-13:-XX:/\" /usr/share/java/elasticsearch/config/jvm.options || true; } \\\n  # rabbitmq\n  # && apk add -U rabbitmq-server@testing \\\n    # && apk add -U rabbitmq-server \\\n  # adminerevo\n  && mkdir -p /var/www/adminerevo \\\n    && curl -sSLo /var/www/adminerevo/index.php \\\n      \"https://github.com/adminerevo/adminerevo/releases/download/v$ADMINER_VERSION/adminer-$ADMINEREVO_VERSION.php\" \\\n  # cleanup\n  && rm -rf /var/cache/apk/* /tmp/* /var/tmp/* /usr/share/doc/* /usr/share/man/*\n\n# nginx config\nCOPY nginx/nginx.conf /etc/nginx/nginx.conf\nCOPY nginx/conf.d/default.conf /etc/nginx/conf.d/default.conf\n\n# mailcatcher\nCOPY --from=tophfr/mailcatcher /usr/lib/libruby.so.2.5 /usr/lib/libruby.so.2.5\nCOPY --from=tophfr/mailcatcher /usr/lib/ruby/ /usr/lib/ruby/\nCOPY --from=tophfr/mailcatcher /usr/bin/ruby /usr/bin/mailcatcher /usr/bin/\n\n# resource\nCOPY php/index.php /var/www/html/index.php\n\n# supervisor config\nCOPY \\\n  beanstalkd/beanstalkd.ini \\\n  elasticsearch/elasticsearch.ini \\\n  mailcatcher/mailcatcher.ini \\\n  memcached/memcached.ini \\\n  mysql/mysql.ini \\\n  nginx/nginx.ini \\\n  pgsql/pgsql.ini \\\n  php/php-fpm.ini \\\n  # rabbitmq/rabbitmq.ini \\\n  redis/redis.ini \\\n    /etc/supervisor.d/\n\n# entrypoint\nCOPY docker-entrypoint.sh /docker-entrypoint.sh\nRUN chmod +x /docker-entrypoint.sh\n\n# ports\nEXPOSE 11300 11211 9300 9200 9000 6379 5432 3306 88 80 25\n\n# commands\nENTRYPOINT [\"/docker-entrypoint.sh\"]\nCMD [\"supervisord\", \"-n\", \"-j\", \"/supervisord.pid\"]\n"
  },
  {
    "path": "LICENSE",
    "content": "MIT License\n\nCopyright (c) 2019 Jitendra Adhikari\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
  },
  {
    "path": "README.md",
    "content": "## docker-lemp\n\n[![Docker build](https://github.com/adhocore/docker-lemp/actions/workflows/build.yml/badge.svg)](https://github.com/adhocore/docker-lemp/actions/workflows/build.yml)\n[![Tweet](https://img.shields.io/twitter/url/http/shields.io.svg?style=social)](https://twitter.com/intent/tweet?text=Complete+LEMP+fullstack+for+local+development+using+docker&url=https://github.com/adhocore/docker-lemp&hashtags=docker,lemp,fullstack,localdev)\n[![Support](https://img.shields.io/static/v1?label=Support&message=%E2%9D%A4&logo=GitHub)](https://github.com/sponsors/adhocore)\n<!-- [![Donate 15](https://img.shields.io/badge/donate-paypal-blue.svg?style=flat-square&label=donate+15)](https://www.paypal.me/ji10/15usd)\n[![Donate 25](https://img.shields.io/badge/donate-paypal-blue.svg?style=flat-square&label=donate+25)](https://www.paypal.me/ji10/25usd)\n[![Donate 50](https://img.shields.io/badge/donate-paypal-blue.svg?style=flat-square&label=donate+50)](https://www.paypal.me/ji10/50usd) -->\n\n\n> Do not use this LEMP in Production.\n> For production, use [adhocore/phpfpm](https://github.com/adhocore/docker-phpfpm)\n> then [compose](https://docs.docker.com/compose/install/) a stack using individual `nginx`, `redis`, `mysql` etc images.\n\n[`adhocore/lemp`](https://hub.docker.com/r/adhocore/lemp) is a minimal single container LEMP full stack for local development.\n\nIt is quick jumpstart for onboarding you into docker based development.\nThe download size is just about ~350MB which is tiny considering how much tools and stuffs it contains.\n\nThe docker container `adhocore/lemp` is composed of:\n\nName             | Version    | Port\n-----------------|------------|------\nadminerevo       | 4.8.4      | 80\nalpine           | 3.16       | -\nbeanstalkd       | 1.12       | 11300\nelasticsearch    | 6.4.3      | 9200,9300\nmailcatcher      | 0.7.1      | 88,25\nmemcached        | 1.6.15     | 11211\nMySQL`*`         | 5.7        | 3306\nnginx            | 1.21.1     | 80\n~phalcon~`\"`     | 5.0.3      | -\nPHP8.3`+`        | >=8.3.4    | 9000\nPHP8.2`+`        | >=8.2.17   | 9000\nPHP8.1`+`        | >=8.1.27   | 9000\nPHP8.0`+`        | >=8.0.30   | 9000\nPHP7.4`~`        | >=7.4.33   | 9000\nPostgreSQL       | 14.7       | 5432\n~rabbitmq~`^`    | 3.8.*      | 5672\nredis            | 7.0.10     | 6379\n~swoole~`\"`      | 4.8.9      | -\n\n> `*`: Actually [MariaDB 10.6.12](https://mariadb.com/kb/en/mariadb-vs-mysql-compatibility/).\n\n> `+`: Different image tags each, viz `:8.3`, `:8.2`, `:8.1`, `:8.0` and `:7.4`.\n\n> `~`: PHP 7.4 has reached end of life and is **deprecated**.\n\n> `\"`: swoole, phalcon have been disabled for now in order to optimize and speed up multiplatform builds (amd64/arm64) but can be [added back](https://github.com/adhocore/docker-lemp/issues/41#issuecomment-1639873818).\n\n## Usage\n\nInstall [docker](https://docs.docker.com/install/) in your machine.\nAlso recommended to install [docker-compose](https://docs.docker.com/compose/install/).\n\n```sh\n# pull latest image\ndocker pull adhocore/lemp:8.3\n\n# or with PHP8.2\ndocker pull adhocore/lemp:8.2\n\n# or with PHP8.1\ndocker pull adhocore/lemp:8.1\n\n# or with PHP8.0\ndocker pull adhocore/lemp:8.0\n\n# or if you *still* use php 7.4 (which you should not):\ndocker pull adhocore/lemp:7.4\n\n# Go to your project root then run\ndocker run -p 8080:80 -p 8888:88 -v `pwd`:/var/www/html --name lemp -d adhocore/lemp:8.3\n\n# In windows, you would use %cd% instead of `pwd`\ndocker run -p 8080:80 -p 8888:88 -v %cd%:/var/www/html --name lemp -d adhocore/lemp:8.3\n\n# If you want to setup MySQL credentials, pass env vars\ndocker run -p 8080:80 -p 8888:88 -v `pwd`:/var/www/html \\\n  -e MYSQL_ROOT_PASSWORD=1234567890 -e MYSQL_DATABASE=appdb \\\n  -e MYSQL_USER=dbuser -e MYSQL_PASSWORD=123456 \\\n  --name lemp -d adhocore/lemp:8.2\n  # for postgres you can pass in similar env as for mysql but with PGSQL_ prefix\n```\n\nAfter running container as above, you will be able to browse [localhost:8080](http://localhost:8080)!\n\nThe database adminerevo will be available for [mysql](http://localhost:8080/adminerevo?server=127.0.0.1%3A3306&username=root)\nand [postgres](http://localhost:8080/adminerevo?pgsql=127.0.0.1%3A5432&username=postgres).\n\nThe mailcatcher will be available at [localhost:8888](http://localhost:8888) which displays mails in realtime.\n\n### Stop container\n\nTo stop the container, you would run:\n\n```sh\ndocker stop lemp\n```\n\n### (Re)Start container\n\nYou dont have to always do `docker run` as in above unless you removed or lost your `lemp` container.\n\nInstead, you can just start when needed:\n\n```sh\ndocker start lemp\n```\n\n> **PRO** If you develop multiple apps, you can create multiple lemp containers with different names.\n>\n> eg: `docker run -p 8081:80 -v $(pwd):/var/www/html --name new-lemp -d adhocore/lemp:8.3`\n\n\n## With Docker compose\n\nCreate a `docker-compose.yml` in your project root with contents something similar to:\n\n```yaml\n# ./docker-compose.yml\nversion: '3'\n\nservices:\n  app:\n    image: adhocore/lemp:8.3\n    # For different app you can use different names. (eg: )\n    container_name: some-app\n    volumes:\n      # app source code\n      - ./path/to/your/app:/var/www/html\n      # db data persistence\n      - db_data:/var/lib/mysql\n      # Here you can also volume php ini settings\n      # - /path/to/zz-overrides:/usr/local/etc/php/conf.d/zz-overrides.ini\n    ports:\n      - 8080:80\n    environment:\n      MYSQL_ROOT_PASSWORD: supersecurepwd\n      MYSQL_DATABASE: appdb\n      MYSQL_USER: dbusr\n      MYSQL_PASSWORD: securepwd\n      # for postgres you can pass in similar env as for mysql but with PGSQL_ prefix\n\nvolumes:\n  db_data: {}\n```\n\nThen all you gotta do is:\n\n```sh\n# To start\ndocker-compose up -d\n\n# To stop\ndocker-compose stop\n```\n\nAs you can see using compose is very neat, intuitive and easy.\nPlus you can already set the volumes and ports there, so you dont have to type in terminal.\n\n### MySQL Default credentials\n\n- **root password**: 1234567890 (if `MYSQL_ROOT_PASSWORD` is not passed)\n- **user password**: 123456 (if `MYSQL_USER` is passed but `MYSQL_PASSWORD` is not)\n\n### PgSQL Default credentials\n\n- **postgres password**: 1234567890 (if `PGSQL_ROOT_PASSWORD` is not passed)\n- **user password**: 123456 (if `PGSQL_USER` is passed but `PGSQL_PASSWORD` is not)\n\n\n#### Accessing DB\n\nIn PHP app you can access MySQL db via PDO like so:\n```php\n$db = new PDO(\n    'mysql:host=127.0.0.1;port=3306;dbname=' . getenv('MYSQL_DATABASE'),\n    getenv('MYSQL_USER'),\n    getenv('MYSQL_PASSWORD')\n);\n```\n\nYou can access PgSQL db via PDO like so:\n```php\n$pdb = new PDO(\n    'pgsql:host=127.0.0.1;port=5432;dbname=' . getenv('PGSQL_DATABASE'),\n    getenv('PGSQL_USER'),\n    getenv('PGSQL_PASSWORD')\n);\n```\n\n### Nginx\n\nURL rewrite is already enabled for you.\n\nEither your app has `public/` folder or not, the rewrite adapts automatically.\n\n### PHP\n\nFor available extensions, check [adhocore/phpfpm#extensions](https://github.com/adhocore/docker-phpfpm#extensions).\n\n### Disabling services\n\n[Pass in env var](https://www.cloudsavvyit.com/14081/how-to-pass-environment-variables-to-docker-containers/)\n`DISABLE` to the container in CSV format to disable services.\nThe service names must be one or more of below in comma separated format:\n```\nbeanstalkd\nmailcatcher\nmemcached\nmysql\npgsql\nredis\n```\n\n> Example: `DISABLE=beanstalkd,mailcatcher,memcached,pgsql,redis`\n> Essential services like `nginx`, `php`, `adminerevo` cannot be disabled ;).\n\nThe service(s) will be enabled again if you run the container next time without `DISABLE` env or if you remove specific services from `DISABLE` CSV.\n\n### Testing mailcatcher\n\n```sh\n# open shell\ndocker exec -it lemp sh\n\n# send test mail\necho \"\\n\" | sendmail -S 0 test@localhost\n```\n\nThen you will see the new mail in realtime at http://localhost:8888.\n\nOr you can check it in shell as well:\n```sh\n\ncurl 0:88/messages\n```\n"
  },
  {
    "path": "beanstalkd/beanstalkd.ini",
    "content": "[program:beanstalkd]\ncommand=beanstalkd\nautostart=true\nautorestart=true\npriority=7\nstartretries=3\nstopwaitsecs=10\nstdout_logfile=/dev/stdout\nstdout_logfile_maxbytes=0\nstderr_logfile=/dev/stderr\nstderr_logfile_maxbytes=0\n"
  },
  {
    "path": "docker-entrypoint.sh",
    "content": "#!/bin/sh\n\nMYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD:-1234567890}\nMYSQL_PASSWORD=${MYSQL_PASSWORD:-123456}\n\nPGSQL_ROOT_PASSWORD=${PGSQL_ROOT_PASSWORD:-1234567890}\nPGSQL_PASSWORD=${PGSQL_PASSWORD:-123456}\n\nDISABLE=\",$DISABLE,\"\n\nfor S in beanstalkd elasticsearch mailcatcher memcached mysql pgsql rabbitmq redis; do\n  DS=$(echo $DISABLE | grep -q \",$S,\" && echo \"YES\"  || echo \"NO\")\n  if [ \"$DS\" == \"YES\" ]; then\n    if [[ -f \"/etc/supervisor.d/$S.ini\" ]]; then mv \"/etc/supervisor.d/$S.ini\" \"/etc/supervisor.d/$S\"; fi\n  else\n    if [[ -f \"/etc/supervisor.d/$S\" ]]; then mv \"/etc/supervisor.d/$S\" \"/etc/supervisor.d/$S.ini\"; fi\n  fi\ndone\n\nDISABLE_MYSQL=$(echo $DISABLE | grep -q \",mysql,\" && echo \"YES\"  || echo \"NO\")\nDISABLE_PGSQL=$(echo $DISABLE | grep -q \",pgsql,\" && echo \"YES\"  || echo \"NO\")\n\n# init nginx\nif [ ! -d \"/var/tmp/nginx/client_body\" ]; then\n  mkdir -p /run/nginx /var/tmp/nginx/client_body\n  chown nginx:nginx -R /run/nginx /var/tmp/nginx/\nfi\n\n# init mysql\nif [ \"$DISABLE_MYSQL\" != \"YES\" ] && [ ! -f \"/run/mysqld/.init\" ]; then\n  [[ \"$MYSQL_USER\" = \"root\" ]] && echo \"Please set MYSQL_USER other than root\" && exit 1\n\n  SQL=$(mktemp)\n\n  mkdir -p /run/mysqld /var/lib/mysql\n  chown mysql:mysql -R /run/mysqld /var/lib/mysql\n  sed -i -e 's/skip-networking/skip-networking=0/' /etc/my.cnf.d/mariadb-server.cnf\n  mysql_install_db --user=mysql --datadir=/var/lib/mysql\n\n  if [ -n \"$MYSQL_DATABASE\" ]; then\n    echo \"CREATE DATABASE IF NOT EXISTS $MYSQL_DATABASE CHARACTER SET utf8 COLLATE utf8_general_ci;\" >> $SQL\n  fi\n\n  MYSQL_DATABASE=${MYSQL_DATABASE:-*}\n\n  if [ -n \"MYSQL_USER\" ]; then\n    echo \"GRANT ALL ON $MYSQL_DATABASE.* to '$MYSQL_USER'@'localhost' IDENTIFIED BY '$MYSQL_PASSWORD';\" >> $SQL\n    echo \"GRANT ALL ON $MYSQL_DATABASE.* to '$MYSQL_USER'@'127.0.0.1' IDENTIFIED BY '$MYSQL_PASSWORD';\" >> $SQL\n    echo \"GRANT ALL ON $MYSQL_DATABASE.* to '$MYSQL_USER'@'::1' IDENTIFIED BY '$MYSQL_PASSWORD';\" >> $SQL\n  fi\n\n  echo \"ALTER user 'root'@'localhost' IDENTIFIED BY '$MYSQL_ROOT_PASSWORD';\" >> $SQL\n  echo \"DELETE FROM mysql.user WHERE User = '' OR Password = '';\" >> $SQL\n  echo \"FLUSH PRIVILEGES;\" >> $SQL\n\n  cat \"$SQL\" | mysqld --user=mysql --bootstrap --silent-startup --skip-grant-tables=FALSE\n\n  rm -rf ~/.mysql_history ~/.ash_history $SQL\n  touch /run/mysqld/.init\nfi\n\n# init pgsql\nif [ \"$DISABLE_PGSQL\" != \"YES\" ] && [ ! -f /run/postgresql/.init ]; then\n  [[ \"$PGSQL_USER\" = \"postgres\" ]] && echo \"Please set PGSQL_USER other than postgres\" && exit 1\n\n  SQL=$(mktemp)\n\n  mkdir -p /run/postgresql /usr/local/pgsql/data\n  chown postgres:postgres -R /run/postgresql /usr/local/pgsql/data\n  su postgres -c \"initdb -D /usr/local/pgsql/data\"\n\n  PGSQL_DATABASE=${PGSQL_DATABASE:-test}\n  echo \"CREATE DATABASE $PGSQL_DATABASE;\" >> $SQL\n  echo \"ALTER USER postgres PASSWORD '$PGSQL_ROOT_PASSWORD';\" >> $SQL\n  if [ -n \"$PGSQL_USER\" ]; then\n    echo \"CREATE USER $PGSQL_USER WITH ENCRYPTED PASSWORD '$PGSQL_PASSWORD';\" >> $SQL\n    echo \"GRANT ALL PRIVILEGES ON DATABASE $PGSQL_DATABASE TO $PGSQL_USER;\" >> $SQL\n  fi\n  echo \"GRANT ALL PRIVILEGES ON DATABASE $PGSQL_DATABASE TO postgres;\" >> $SQL\n\n  su postgres -c \"pg_ctl -D '/usr/local/pgsql/data' -o '-c listen_addresses='' -p ${PGSQL_PORT:-5432}' -w start\"\n  su -c \"psql --username=postgres --file='$SQL'\"\n  rm -rf ~/.psql_history ~/.ash_history $SQL\n  su postgres -c \"pg_ctl -D '/usr/local/pgsql/data' -m fast -w stop\"\n  sed -i -E 's/host\\s+all(.*)trust/host    all\\1password/' /usr/local/pgsql/data/pg_hba.conf\n  touch /run/postgresql/.init\nfi\n\nexec \"$@\"\n"
  },
  {
    "path": "elasticsearch/elasticsearch.ini",
    "content": "[program:elasticsearch]\ncommand=su elastico -c \"elasticsearch\"\nautostart=true\nautorestart=true\npriority=8\nstartretries=3\nstopwaitsecs=10\nstdout_logfile=/dev/stdout\nstdout_logfile_maxbytes=0\nstderr_logfile=/dev/stderr\nstderr_logfile_maxbytes=0\n"
  },
  {
    "path": "mailcatcher/mailcatcher.ini",
    "content": "[program:mailcatcher]\ncommand=mailcatcher --foreground --ip=0.0.0.0 --smtp-port=25 --http-port=88\nautostart=true\nautorestart=true\npriority=5\nstartretries=3\nstopwaitsecs=10\nstdout_logfile=/dev/stdout\nstdout_logfile_maxbytes=0\nstderr_logfile=/dev/stderr\nstderr_logfile_maxbytes=0\n"
  },
  {
    "path": "memcached/memcached.ini",
    "content": "[program:memcached]\ncommand=memcached -u memcached\nautostart=true\nautorestart=true\npriority=5\nstartretries=3\nstopwaitsecs=10\nstdout_logfile=/dev/stdout\nstdout_logfile_maxbytes=0\nstderr_logfile=/dev/stderr\nstderr_logfile_maxbytes=0\n"
  },
  {
    "path": "mysql/mysql.ini",
    "content": "# for supervisord\n[program:mysqld]\ncommand=mysqld --user=mysql\nautostart=true\nautorestart=true\npriority=1\nstartretries=3\nstopwaitsecs=10\nstdout_logfile=/dev/stdout\nstdout_logfile_maxbytes=0\nstderr_logfile=/dev/stderr\nstderr_logfile_maxbytes=0\n"
  },
  {
    "path": "nginx/conf.d/default.conf",
    "content": "server {\n  listen 80;\n  listen [::]:80 ipv6only=on default_server;\n  server_name _;\n\n  index index.php index.html index.htm;\n\n  set $docroot \"html\";\n  if (-d \"/var/www/html/public\") {\n    set $docroot \"html/public\";\n  }\n  if ($request_filename ~ /(adminerevo|adminer)/) {\n    set $docroot \"adminerevo\";\n  }\n\n  root \"/var/www/${docroot}\";\n\n  if (!-e $request_filename) {\n    rewrite ^.*$ /index.php last;\n  }\n\n  location ~ \\.php$ {\n    fastcgi_pass 0.0.0.0:9000;\n    fastcgi_index index.php;\n    fastcgi_split_path_info ^(.+\\.php)(/.+)$;\n    fastcgi_param PATH_INFO $fastcgi_path_info;\n    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;\n    fastcgi_buffers 16 16k;\n    fastcgi_buffer_size 32k;\n    include fastcgi_params;\n  }\n\n  location ~ /\\.ht {\n    deny all;\n  }\n}\n"
  },
  {
    "path": "nginx/nginx.conf",
    "content": "user  nginx;\ndaemon  off;\nworker_processes  10;\n\n# error_log  /var/log/nginx/error.log warn;\npid  /var/run/nginx.pid;\n\nevents {\n  worker_connections  1024;\n}\n\nhttp {\n  include  /etc/nginx/mime.types;\n  default_type  application/octet-stream;\n\n  log_format  main  '$remote_addr - $remote_user [$time_local] \"$request\" '\n    '$status $body_bytes_sent \"$http_referer\" '\n    '\"$http_user_agent\" \"$http_x_forwarded_for\"';\n\n  sendfile  on;\n  tcp_nopush  on;\n\n  keepalive_timeout  65;\n\n  # gzip  on;\n\n  include /etc/nginx/conf.d/*.conf;\n}\n"
  },
  {
    "path": "nginx/nginx.ini",
    "content": "# for supervisord\n[program:nginx]\ncommand=nginx -c /etc/nginx/nginx.conf\nautostart=true\nautorestart=true\npriority=3\nstartretries=3\nstopwaitsecs=10\nstdout_logfile=/dev/stdout\nstdout_logfile_maxbytes=0\nstderr_logfile=/dev/stderr\nstderr_logfile_maxbytes=0\n"
  },
  {
    "path": "pgsql/pgsql.ini",
    "content": "# for supervisord\n[program:postgres]\ncommand=su postgres -c \"postgres -D /usr/local/pgsql/data\"\nautostart=true\nautorestart=true\npriority=4\nstartretries=3\nstopwaitsecs=10\nstdout_logfile=/dev/stdout\nstdout_logfile_maxbytes=0\nstderr_logfile=/dev/stderr\nstderr_logfile_maxbytes=0\n"
  },
  {
    "path": "php/index.php",
    "content": "<?php\n\n$works = \"<p>If you see this, that means it works!</p>\\n\\n\";\necho PHP_SAPI == 'cli' ? strip_tags($works) : $works;\n\n$mdb = new PDO(\n    'mysql:host=127.0.0.1;port=3306;dbname=' . (getenv('MYSQL_DATABASE') ?: 'test'),\n    getenv('MYSQL_USER') ?: 'root',\n    getenv('MYSQL_PASSWORD') ?: '1234567890'\n);\n\n$pdb = new PDO(\n    'pgsql:host=127.0.0.1;port=5432;dbname=' . (getenv('PGSQL_DATABASE') ?: 'postgres'),\n    getenv('PGSQL_USER') ?: 'postgres',\n    getenv('PGSQL_PASSWORD') ?: '1234567890'\n);\n\nif (PHP_SAPI !== 'cli') echo \"<pre>\\n\";\n\necho 'MySQL NOW(): ', $mdb->query('SELECT NOW()')->fetchColumn() . \"\\n\";\necho 'PgSQL NOW(): ', $pdb->query('SELECT NOW()')->fetchColumn() . \"\\n\\n\";\necho 'PHP: ', phpversion(), \"\\n\\n\";\n\n$extensions = get_loaded_extensions();\n$extensions = array_map('strtolower', $extensions);\n\necho \"Extensions: \", count($extensions), \"\\n\\n\";\n\nsort($extensions);\nforeach (array_chunk($extensions, 4) as $exts) {\n    foreach ($exts as $ext) {\n        echo '- ' . str_pad($ext, 18, ' ', STR_PAD_RIGHT);\n    }\n    echo \"\\n\";\n}\n\necho PHP_SAPI === 'cli'\n    ? \"\\nSource code: https://github.com/adhocore/docker-lemp\\n\\n\"\n    : \"</pre>\\n\\n\"\n        . 'Source code: <a href=\"https://github.com/adhocore/docker-lemp\" target=\"_blank\">adhocore/docker-lemp</a>'\n        . ' | Adminerevo: <a href=\"/adminerevo?server=127.0.0.1%3A3306&username=root\" target=\"_blank\">mysql</a>, '\n        . ' <a href=\"/adminerevo?pgsql=127.0.0.1%3A5432&username=postgres\" target=\"_blank\">postgres</a>'\n        . \"\\n\";\n"
  },
  {
    "path": "php/php-fpm.ini",
    "content": "# for supervisord\n[program:php-fpm]\ncommand=php-fpm --nodaemonize --fpm-config /usr/local/etc/php-fpm.conf\nautostart=true\nautorestart=true\npriority=2\nstartretries=3\nstopwaitsecs=10\nstdout_logfile=/dev/stdout\nstdout_logfile_maxbytes=0\nstderr_logfile=/dev/stderr\nstderr_logfile_maxbytes=0\n"
  },
  {
    "path": "rabbitmq/rabbitmq.ini",
    "content": "[program:rabbitmq-server]\ncommand=rabbitmq-server\nautostart=true\nautorestart=true\npriority=7\nstartretries=3\nstopwaitsecs=10\nstdout_logfile=/dev/stdout\nstdout_logfile_maxbytes=0\nstderr_logfile=/dev/stderr\nstderr_logfile_maxbytes=0\n"
  },
  {
    "path": "redis/redis.ini",
    "content": "[program:redis-server]\ncommand=redis-server\nautostart=true\nautorestart=true\npriority=6\nstartretries=3\nstopwaitsecs=10\nstdout_logfile=/dev/stdout\nstdout_logfile_maxbytes=0\nstderr_logfile=/dev/stderr\nstderr_logfile_maxbytes=0\n"
  }
]