Full Code of adhocore/docker-lemp for AI

main f64afafd3fc5 cached
28 files
36.8 KB
12.6k tokens
1 requests
Download .txt
Repository: adhocore/docker-lemp
Branch: main
Commit: f64afafd3fc5
Files: 28
Total size: 36.8 KB

Directory structure:
gitextract_cpq1w5vp/

├── .dockerignore
├── .editorconfig
├── .github/
│   ├── FUNDING.yml
│   └── workflows/
│       ├── build.yml
│       ├── build_manual.yml
│       └── build_preview.yml
├── .gitignore
├── 7.4.Dockerfile
├── 8.0.Dockerfile
├── 8.1.Dockerfile
├── 8.2.Dockerfile
├── 8.3.Dockerfile
├── LICENSE
├── README.md
├── beanstalkd/
│   └── beanstalkd.ini
├── docker-entrypoint.sh
├── elasticsearch/
│   └── elasticsearch.ini
├── mailcatcher/
│   └── mailcatcher.ini
├── memcached/
│   └── memcached.ini
├── mysql/
│   └── mysql.ini
├── nginx/
│   ├── conf.d/
│   │   └── default.conf
│   ├── nginx.conf
│   └── nginx.ini
├── pgsql/
│   └── pgsql.ini
├── php/
│   ├── index.php
│   └── php-fpm.ini
├── rabbitmq/
│   └── rabbitmq.ini
└── redis/
    └── redis.ini

================================================
FILE CONTENTS
================================================

================================================
FILE: .dockerignore
================================================
.git
.github
.gitignore
.editorconfig
docker-compose.yml
README.md


================================================
FILE: .editorconfig
================================================
; http://editorconfig.org
;
; Sublime: https://github.com/sindresorhus/editorconfig-sublime
; Phpstorm: https://plugins.jetbrains.com/plugin/7294-editorconfig

root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[{*.md,*.php}]
indent_size = 4


================================================
FILE: .github/FUNDING.yml
================================================
github: adhocore
custom: ['https://paypal.me/ji10']


================================================
FILE: .github/workflows/build.yml
================================================
name: build

on:
  workflow_dispatch:
  push:
    branches:
      - 'main'

jobs:
  docker:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v4
      - name: Set up QEMU
        uses: docker/setup-qemu-action@v2
      - name: Set up Docker Buildx
        uses: docker/setup-buildx-action@v2
      - name: Login to DockerHub
        uses: docker/login-action@v2
        with:
          username: ${{ secrets.DOCKERHUB_USERNAME }}
          password: ${{ secrets.DOCKERHUB_TOKEN }}
      - name: "Docker Pull"
        run: |
          docker pull adhocore/phpfpm:8.0 || true
          docker pull adhocore/phpfpm:8.1 || true
          docker pull adhocore/phpfpm:8.2 || true
          docker pull adhocore/phpfpm:8.3 || true

      - name: "[8.3] Build and push"
        id: docker_build_83
        uses: docker/build-push-action@v4
        with:
          push: true
          file: 8.3.Dockerfile
          tags: adhocore/lemp:8.3,adhocore/lemp:latest
          platforms: linux/amd64,linux/arm64
      - name: "[8.2] Build and push"
        id: docker_build_82
        uses: docker/build-push-action@v4
        with:
          push: true
          file: 8.2.Dockerfile
          tags: adhocore/lemp:8.2
          platforms: linux/amd64,linux/arm64
      - name: "[8.1] Build and push"
        id: docker_build_81
        uses: docker/build-push-action@v4
        with:
          push: true
          file: 8.1.Dockerfile
          tags: adhocore/lemp:8.1
          platforms: linux/amd64,linux/arm64
      - name: "[8.0] Build and push"
        id: docker_build_80
        uses: docker/build-push-action@v4
        with:
          push: true
          file: 8.0.Dockerfile
          tags: adhocore/lemp:8.0
          platforms: linux/amd64,linux/arm64

      - name: "[8.3] Test"
        run: |
          docker run --name lemp83 adhocore/lemp:8.3 &
          sleep 60
          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'
          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)
          sleep 1 && docker stop lemp83 > /dev/null || true
          [[ "10" == "$PORTS" ]] || { echo '[8.3] Not all ports are open' && exit 1; }
      - name: "[8.2] Test"
        run: |
          docker run --name lemp82 adhocore/lemp:8.2 &
          sleep 60
          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'
          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)
          sleep 1 && docker stop lemp82 > /dev/null || true
          [[ "11" == "$PORTS" ]] || { echo '[8.2] Not all ports are open' && exit 1; }
      - name: "[8.1] Test"
        run: |
          docker run --name lemp81 adhocore/lemp:8.1 &
          sleep 60
          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'
          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)
          sleep 1 && docker stop lemp81 > /dev/null || true
          [[ "11" == "$PORTS" ]] || { echo '[8.1] Not all ports are open' && exit 1; }
      - name: "[8.0] Test"
        run: |
          docker run --name lemp80 adhocore/lemp:8.0 &
          sleep 60
          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'
          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)
          sleep 1 && docker stop lemp80 > /dev/null || true
          [[ "11" == "$PORTS" ]] || { echo '[8.0] Not all ports are open' && exit 1; }



================================================
FILE: .github/workflows/build_manual.yml
================================================
name: build_manual

on:
  workflow_dispatch:

jobs:
  docker:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v3
      - name: Set up QEMU
        uses: docker/setup-qemu-action@v2
      - name: Set up Docker Buildx
        uses: docker/setup-buildx-action@v2
      - name: Login to DockerHub
        uses: docker/login-action@v2
        with:
          username: ${{ secrets.DOCKERHUB_USERNAME }}
          password: ${{ secrets.DOCKERHUB_TOKEN }}
      - name: "Docker Pull"
        run: |
          docker pull adhocore/phpfpm:7.4 || true
      - name: "[7.4] Build and push"
        id: docker_build_74
        uses: docker/build-push-action@v4
        with:
          push: true
          file: 7.4.Dockerfile
          tags: adhocore/lemp:7.4
          platforms: linux/amd64,linux/arm64
      - name: "[7.4] Test"
        run: |
          docker run --name lemp74 adhocore/lemp:7.4 &
          sleep 60
          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'
          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)
          sleep 1 && docker stop lemp74 > /dev/null || true
          [[ "11" == "$PORTS" ]] || { echo '[7.4] Not all ports are open' && exit 1; }



================================================
FILE: .github/workflows/build_preview.yml
================================================
name: build_preview

on:
  workflow_dispatch:

jobs:
  docker:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v3
      - name: Set up QEMU
        uses: docker/setup-qemu-action@v2
      - name: Set up Docker Buildx
        uses: docker/setup-buildx-action@v2
      - name: Login to DockerHub
        uses: docker/login-action@v2
        with:
          username: ${{ secrets.DOCKERHUB_USERNAME }}
          password: ${{ secrets.DOCKERHUB_TOKEN }}
      - name: "Docker Pull"
        run: |
          docker pull adhocore/phpfpm:7.4 || true
      - name: "[8.3] Build and push"
        id: docker_build_83
        uses: docker/build-push-action@v4
        with:
          push: true
          file: 8.3.Dockerfile
          tags: adhocore/lemp:8.3b
          platforms: linux/amd64,linux/arm64
      - name: "[8.3] Test"
        run: |
          docker run --name lemp83 adhocore/lemp:8.3b &
          sleep 60
          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'
          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)
          sleep 1 && docker stop lemp83 > /dev/null || true
          [[ "10" == "$PORTS" ]] || { echo '[8.3] Not all ports are open' && exit 1; }


================================================
FILE: .gitignore
================================================
docker-compose.yml
docker-project.json


================================================
FILE: 7.4.Dockerfile
================================================
FROM adhocore/phpfpm:7.4

MAINTAINER Jitendra Adhikari <jiten.adhikary@gmail.com>

ENV \
  ADMINEREVO_VERSION=4.8.4 \
  ES_HOME=/usr/share/java/elasticsearch \
  PATH=/usr/share/java/elasticsearch/bin:$PATH

RUN \
  # prepare
  echo @legacy https://dl-cdn.alpinelinux.org/alpine/v3.12/community >> /etc/apk/repositories \
  # install
  && apk add -U --no-cache \
    beanstalkd \
    elasticsearch@legacy \
    memcached \
    mysql mysql-client \
    nano \
    nginx \
    postgresql \
    redis \
    supervisor \
  # elastic setup
  && rm -rf $ES_HOME/plugins \
    && mkdir -p $ES_HOME/tmp $ES_HOME/data $ES_HOME/logs $ES_HOME/plugins $ES_HOME/config/scripts \
      && mv /etc/elasticsearch/* $ES_HOME/config/ \
    # elastico user
    && deluser elastico && addgroup -S elastico \
      && adduser -D -S -h /usr/share/java/elasticsearch -s /bin/ash -G elastico elastico \
      && chown elastico:elastico -R $ES_HOME \
      && { sed -ie "s/^-XX:/8-13:-XX:/" /usr/share/java/elasticsearch/config/jvm.options || true; } \
  # rabbitmq
  # && echo @testing http://nl.alpinelinux.org/alpine/edge/testing >> /etc/apk/repositories \
    # && apk add -U rabbitmq-server@testing \
    # && apk add -U rabbitmq-server \
  # adminerevo
  && mkdir -p /var/www/adminerevo \
    && curl -sSLo /var/www/adminerevo/index.php \
      "https://github.com/adminerevo/adminerevo/releases/download/v$ADMINEREVO_VERSION/adminer-$ADMINEREVO_VERSION.php" \
  # cleanup
  && rm -rf /var/cache/apk/* /tmp/* /var/tmp/* /usr/share/doc/* /usr/share/man/*

# nginx config
COPY nginx/nginx.conf /etc/nginx/nginx.conf
COPY nginx/conf.d/default.conf /etc/nginx/conf.d/default.conf

# mailcatcher
COPY --from=tophfr/mailcatcher /usr/lib/libruby.so.2.5 /usr/lib/libruby.so.2.5
COPY --from=tophfr/mailcatcher /usr/lib/ruby/ /usr/lib/ruby/
COPY --from=tophfr/mailcatcher /usr/bin/ruby /usr/bin/mailcatcher /usr/bin/

# resource
COPY php/index.php /var/www/html/index.php

# supervisor config
COPY \
  beanstalkd/beanstalkd.ini \
  elasticsearch/elasticsearch.ini \
  mailcatcher/mailcatcher.ini \
  memcached/memcached.ini \
  mysql/mysql.ini \
  nginx/nginx.ini \
  pgsql/pgsql.ini \
  php/php-fpm.ini \
  # rabbitmq/rabbitmq.ini \
  redis/redis.ini \
    /etc/supervisor.d/

# entrypoint
COPY docker-entrypoint.sh /docker-entrypoint.sh
RUN chmod +x /docker-entrypoint.sh

# ports
EXPOSE 11300 11211 9300 9200 9000 6379 5432 3306 88 80 25

# commands
ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["supervisord", "-n", "-j", "/supervisord.pid"]


================================================
FILE: 8.0.Dockerfile
================================================
FROM adhocore/phpfpm:8.0

MAINTAINER Jitendra Adhikari <jiten.adhikary@gmail.com>

ENV \
  ADMINEREVO_VERSION=4.8.4 \
  ES_HOME=/usr/share/java/elasticsearch \
  PATH=/usr/share/java/elasticsearch/bin:$PATH

RUN \
  # prepare
  echo @legacy https://dl-cdn.alpinelinux.org/alpine/v3.12/community >> /etc/apk/repositories \
  # install
  && apk add -U --no-cache \
    beanstalkd \
    elasticsearch@legacy \
    memcached \
    mysql mysql-client \
    nano \
    nginx \
    postgresql \
    redis \
    supervisor \
    poppler-utils \
  # elastic setup
  && rm -rf $ES_HOME/plugins \
    && mkdir -p $ES_HOME/tmp $ES_HOME/data $ES_HOME/logs $ES_HOME/plugins $ES_HOME/config/scripts \
      && mv /etc/elasticsearch/* $ES_HOME/config/ \
    # elastico user
    && deluser elastico && addgroup -S elastico \
      && adduser -D -S -h /usr/share/java/elasticsearch -s /bin/ash -G elastico elastico \
      && chown elastico:elastico -R $ES_HOME \
      && { sed -ie "s/^-XX:/8-13:-XX:/" /usr/share/java/elasticsearch/config/jvm.options || true; } \
  # rabbitmq
  # && echo @testing http://nl.alpinelinux.org/alpine/edge/testing >> /etc/apk/repositories \
    # && apk add -U rabbitmq-server@testing \
    # && apk add -U rabbitmq-server \
  # adminerevo
  && mkdir -p /var/www/adminerevo \
    && curl -sSLo /var/www/adminerevo/index.php \
      "https://github.com/adminerevo/adminerevo/releases/download/v$ADMINEREVO_VERSION/adminer-$ADMINEREVO_VERSION.php" \
  # cleanup
  && rm -rf /var/cache/apk/* /tmp/* /var/tmp/* /usr/share/doc/* /usr/share/man/*

# nginx config
COPY nginx/nginx.conf /etc/nginx/nginx.conf
COPY nginx/conf.d/default.conf /etc/nginx/conf.d/default.conf

# mailcatcher
COPY --from=tophfr/mailcatcher /usr/lib/libruby.so.2.5 /usr/lib/libruby.so.2.5
COPY --from=tophfr/mailcatcher /usr/lib/ruby/ /usr/lib/ruby/
COPY --from=tophfr/mailcatcher /usr/bin/ruby /usr/bin/mailcatcher /usr/bin/

# resource
COPY php/index.php /var/www/html/index.php

# supervisor config
COPY \
  beanstalkd/beanstalkd.ini \
  elasticsearch/elasticsearch.ini \
  mailcatcher/mailcatcher.ini \
  memcached/memcached.ini \
  mysql/mysql.ini \
  nginx/nginx.ini \
  pgsql/pgsql.ini \
  php/php-fpm.ini \
  # rabbitmq/rabbitmq.ini \
  redis/redis.ini \
    /etc/supervisor.d/

# entrypoint
COPY docker-entrypoint.sh /docker-entrypoint.sh
RUN chmod +x /docker-entrypoint.sh

# ports
EXPOSE 11300 11211 9300 9200 9000 6379 5432 3306 88 80 25

# commands
ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["supervisord", "-n", "-j", "/supervisord.pid"]


================================================
FILE: 8.1.Dockerfile
================================================
FROM adhocore/phpfpm:8.1

MAINTAINER Jitendra Adhikari <jiten.adhikary@gmail.com>

ENV \
  ADMINEREVO_VERSION=4.8.4 \
  ES_HOME=/usr/share/java/elasticsearch \
  PATH=/usr/share/java/elasticsearch/bin:$PATH

RUN \
  # prepare
  echo @legacy https://dl-cdn.alpinelinux.org/alpine/v3.12/community >> /etc/apk/repositories \
  # install
  && apk add -U --no-cache libssl1.1 \
    beanstalkd \
    elasticsearch@legacy \
    memcached \
    mysql mysql-client \
    nano \
    nginx \
    postgresql \
    # rabbitmq-server@testing \
    redis \
    supervisor \
    poppler-utils \
  # elastic setup
  && rm -rf $ES_HOME/plugins \
    && mkdir -p $ES_HOME/tmp $ES_HOME/data $ES_HOME/logs $ES_HOME/plugins $ES_HOME/config/scripts \
      && mv /etc/elasticsearch/* $ES_HOME/config/ \
    # elastico user
    && deluser elastico && addgroup -S elastico \
      && adduser -D -S -h /usr/share/java/elasticsearch -s /bin/ash -G elastico elastico \
      && chown elastico:elastico -R $ES_HOME \
      && { sed -ie "s/^-XX:/8-13:-XX:/" /usr/share/java/elasticsearch/config/jvm.options || true; } \
  # rabbitmq
  # && apk add -U rabbitmq-server@testing \
    # && apk add -U rabbitmq-server \
  # adminerevo
  && mkdir -p /var/www/adminerevo \
    && curl -sSLo /var/www/adminerevo/index.php \
      "https://github.com/adminerevo/adminerevo/releases/download/v$ADMINEREVO_VERSION/adminer-$ADMINEREVO_VERSION.php" \
  # cleanup
  && rm -rf /var/cache/apk/* /tmp/* /var/tmp/* /usr/share/doc/* /usr/share/man/*

# nginx config
COPY nginx/nginx.conf /etc/nginx/nginx.conf
COPY nginx/conf.d/default.conf /etc/nginx/conf.d/default.conf

# mailcatcher
COPY --from=tophfr/mailcatcher /usr/lib/libruby.so.2.5 /usr/lib/libruby.so.2.5
COPY --from=tophfr/mailcatcher /usr/lib/ruby/ /usr/lib/ruby/
COPY --from=tophfr/mailcatcher /usr/bin/ruby /usr/bin/mailcatcher /usr/bin/

# resource
COPY php/index.php /var/www/html/index.php

# supervisor config
COPY \
  beanstalkd/beanstalkd.ini \
  elasticsearch/elasticsearch.ini \
  mailcatcher/mailcatcher.ini \
  memcached/memcached.ini \
  mysql/mysql.ini \
  nginx/nginx.ini \
  pgsql/pgsql.ini \
  php/php-fpm.ini \
  # rabbitmq/rabbitmq.ini \
  redis/redis.ini \
    /etc/supervisor.d/

# entrypoint
COPY docker-entrypoint.sh /docker-entrypoint.sh
RUN chmod +x /docker-entrypoint.sh

# ports
EXPOSE 11300 11211 9300 9200 9000 6379 5432 3306 88 80 25

# commands
ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["supervisord", "-n", "-j", "/supervisord.pid"]


================================================
FILE: 8.2.Dockerfile
================================================
FROM adhocore/phpfpm:8.2

MAINTAINER Jitendra Adhikari <jiten.adhikary@gmail.com>

ENV \
  ADMINEREVO_VERSION=4.8.4 \
  ES_HOME=/usr/share/java/elasticsearch \
  PATH=/usr/share/java/elasticsearch/bin:$PATH

RUN \
  # prepare
  echo @legacy https://dl-cdn.alpinelinux.org/alpine/v3.12/community >> /etc/apk/repositories \
  # install
  && apk add -U --no-cache libssl1.1 \
    beanstalkd \
    elasticsearch@legacy \
    memcached \
    mysql mysql-client \
    nano \
    nginx \
    postgresql \
    # rabbitmq-server@testing \
    redis \
    supervisor \
    poppler-utils \
  # elastic setup
  && rm -rf $ES_HOME/plugins \
    && mkdir -p $ES_HOME/tmp $ES_HOME/data $ES_HOME/logs $ES_HOME/plugins $ES_HOME/config/scripts \
      && mv /etc/elasticsearch/* $ES_HOME/config/ \
    # elastico user
    && deluser elastico && addgroup -S elastico \
      && adduser -D -S -h /usr/share/java/elasticsearch -s /bin/ash -G elastico elastico \
      && chown elastico:elastico -R $ES_HOME \
      && { sed -ie "s/^-XX:/8-13:-XX:/" /usr/share/java/elasticsearch/config/jvm.options || true; } \
  # rabbitmq
  # && apk add -U rabbitmq-server@testing \
    # && apk add -U rabbitmq-server \
  # adminerevo
  && mkdir -p /var/www/adminerevo \
    && curl -sSLo /var/www/adminerevo/index.php \
      "https://github.com/adminerevo/adminerevo/releases/download/v$ADMINEREVO_VERSION/adminer-$ADMINEREVO_VERSION.php" \
  # cleanup
  && rm -rf /var/cache/apk/* /tmp/* /var/tmp/* /usr/share/doc/* /usr/share/man/*

# nginx config
COPY nginx/nginx.conf /etc/nginx/nginx.conf
COPY nginx/conf.d/default.conf /etc/nginx/conf.d/default.conf

# mailcatcher
COPY --from=tophfr/mailcatcher /usr/lib/libruby.so.2.5 /usr/lib/libruby.so.2.5
COPY --from=tophfr/mailcatcher /usr/lib/ruby/ /usr/lib/ruby/
COPY --from=tophfr/mailcatcher /usr/bin/ruby /usr/bin/mailcatcher /usr/bin/

# resource
COPY php/index.php /var/www/html/index.php

# supervisor config
COPY \
  beanstalkd/beanstalkd.ini \
  elasticsearch/elasticsearch.ini \
  mailcatcher/mailcatcher.ini \
  memcached/memcached.ini \
  mysql/mysql.ini \
  nginx/nginx.ini \
  pgsql/pgsql.ini \
  php/php-fpm.ini \
  # rabbitmq/rabbitmq.ini \
  redis/redis.ini \
    /etc/supervisor.d/

# entrypoint
COPY docker-entrypoint.sh /docker-entrypoint.sh
RUN chmod +x /docker-entrypoint.sh

# ports
EXPOSE 11300 11211 9300 9200 9000 6379 5432 3306 88 80 25

# commands
ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["supervisord", "-n", "-j", "/supervisord.pid"]


================================================
FILE: 8.3.Dockerfile
================================================
FROM adhocore/phpfpm:8.3a

MAINTAINER Jitendra Adhikari <jiten.adhikary@gmail.com>

ENV \
  ADMINEREVO_VERSION=4.8.4 \
  ES_HOME=/usr/share/java/elasticsearch \
  PATH=/usr/share/java/elasticsearch/bin:$PATH

RUN \
  # prepare
  echo @legacy https://dl-cdn.alpinelinux.org/alpine/v3.12/community >> /etc/apk/repositories \
  # install
  && apk add -U --no-cache libssl1.1 \
    beanstalkd \
    elasticsearch@legacy \
    memcached \
    mysql mysql-client \
    nano \
    nginx \
    postgresql \
    # rabbitmq-server@testing \
    redis \
    supervisor \
  # elastic setup
  && rm -rf $ES_HOME/plugins \
    && mkdir -p $ES_HOME/tmp $ES_HOME/data $ES_HOME/logs $ES_HOME/plugins $ES_HOME/config/scripts \
      && mv /etc/elasticsearch/* $ES_HOME/config/ \
    # elastico user
    && deluser elastico && addgroup -S elastico \
      && adduser -D -S -h /usr/share/java/elasticsearch -s /bin/ash -G elastico elastico \
      && chown elastico:elastico -R $ES_HOME \
      && { sed -ie "s/^-XX:/8-13:-XX:/" /usr/share/java/elasticsearch/config/jvm.options || true; } \
  # rabbitmq
  # && apk add -U rabbitmq-server@testing \
    # && apk add -U rabbitmq-server \
  # adminerevo
  && mkdir -p /var/www/adminerevo \
    && curl -sSLo /var/www/adminerevo/index.php \
      "https://github.com/adminerevo/adminerevo/releases/download/v$ADMINER_VERSION/adminer-$ADMINEREVO_VERSION.php" \
  # cleanup
  && rm -rf /var/cache/apk/* /tmp/* /var/tmp/* /usr/share/doc/* /usr/share/man/*

# nginx config
COPY nginx/nginx.conf /etc/nginx/nginx.conf
COPY nginx/conf.d/default.conf /etc/nginx/conf.d/default.conf

# mailcatcher
COPY --from=tophfr/mailcatcher /usr/lib/libruby.so.2.5 /usr/lib/libruby.so.2.5
COPY --from=tophfr/mailcatcher /usr/lib/ruby/ /usr/lib/ruby/
COPY --from=tophfr/mailcatcher /usr/bin/ruby /usr/bin/mailcatcher /usr/bin/

# resource
COPY php/index.php /var/www/html/index.php

# supervisor config
COPY \
  beanstalkd/beanstalkd.ini \
  elasticsearch/elasticsearch.ini \
  mailcatcher/mailcatcher.ini \
  memcached/memcached.ini \
  mysql/mysql.ini \
  nginx/nginx.ini \
  pgsql/pgsql.ini \
  php/php-fpm.ini \
  # rabbitmq/rabbitmq.ini \
  redis/redis.ini \
    /etc/supervisor.d/

# entrypoint
COPY docker-entrypoint.sh /docker-entrypoint.sh
RUN chmod +x /docker-entrypoint.sh

# ports
EXPOSE 11300 11211 9300 9200 9000 6379 5432 3306 88 80 25

# commands
ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["supervisord", "-n", "-j", "/supervisord.pid"]


================================================
FILE: LICENSE
================================================
MIT License

Copyright (c) 2019 Jitendra Adhikari

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.


================================================
FILE: README.md
================================================
## docker-lemp

[![Docker build](https://github.com/adhocore/docker-lemp/actions/workflows/build.yml/badge.svg)](https://github.com/adhocore/docker-lemp/actions/workflows/build.yml)
[![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)
[![Support](https://img.shields.io/static/v1?label=Support&message=%E2%9D%A4&logo=GitHub)](https://github.com/sponsors/adhocore)
<!-- [![Donate 15](https://img.shields.io/badge/donate-paypal-blue.svg?style=flat-square&label=donate+15)](https://www.paypal.me/ji10/15usd)
[![Donate 25](https://img.shields.io/badge/donate-paypal-blue.svg?style=flat-square&label=donate+25)](https://www.paypal.me/ji10/25usd)
[![Donate 50](https://img.shields.io/badge/donate-paypal-blue.svg?style=flat-square&label=donate+50)](https://www.paypal.me/ji10/50usd) -->


> Do not use this LEMP in Production.
> For production, use [adhocore/phpfpm](https://github.com/adhocore/docker-phpfpm)
> then [compose](https://docs.docker.com/compose/install/) a stack using individual `nginx`, `redis`, `mysql` etc images.

[`adhocore/lemp`](https://hub.docker.com/r/adhocore/lemp) is a minimal single container LEMP full stack for local development.

It is quick jumpstart for onboarding you into docker based development.
The download size is just about ~350MB which is tiny considering how much tools and stuffs it contains.

The docker container `adhocore/lemp` is composed of:

Name             | Version    | Port
-----------------|------------|------
adminerevo       | 4.8.4      | 80
alpine           | 3.16       | -
beanstalkd       | 1.12       | 11300
elasticsearch    | 6.4.3      | 9200,9300
mailcatcher      | 0.7.1      | 88,25
memcached        | 1.6.15     | 11211
MySQL`*`         | 5.7        | 3306
nginx            | 1.21.1     | 80
~phalcon~`"`     | 5.0.3      | -
PHP8.3`+`        | >=8.3.4    | 9000
PHP8.2`+`        | >=8.2.17   | 9000
PHP8.1`+`        | >=8.1.27   | 9000
PHP8.0`+`        | >=8.0.30   | 9000
PHP7.4`~`        | >=7.4.33   | 9000
PostgreSQL       | 14.7       | 5432
~rabbitmq~`^`    | 3.8.*      | 5672
redis            | 7.0.10     | 6379
~swoole~`"`      | 4.8.9      | -

> `*`: Actually [MariaDB 10.6.12](https://mariadb.com/kb/en/mariadb-vs-mysql-compatibility/).

> `+`: Different image tags each, viz `:8.3`, `:8.2`, `:8.1`, `:8.0` and `:7.4`.

> `~`: PHP 7.4 has reached end of life and is **deprecated**.

> `"`: 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).

## Usage

Install [docker](https://docs.docker.com/install/) in your machine.
Also recommended to install [docker-compose](https://docs.docker.com/compose/install/).

```sh
# pull latest image
docker pull adhocore/lemp:8.3

# or with PHP8.2
docker pull adhocore/lemp:8.2

# or with PHP8.1
docker pull adhocore/lemp:8.1

# or with PHP8.0
docker pull adhocore/lemp:8.0

# or if you *still* use php 7.4 (which you should not):
docker pull adhocore/lemp:7.4

# Go to your project root then run
docker run -p 8080:80 -p 8888:88 -v `pwd`:/var/www/html --name lemp -d adhocore/lemp:8.3

# In windows, you would use %cd% instead of `pwd`
docker run -p 8080:80 -p 8888:88 -v %cd%:/var/www/html --name lemp -d adhocore/lemp:8.3

# If you want to setup MySQL credentials, pass env vars
docker run -p 8080:80 -p 8888:88 -v `pwd`:/var/www/html \
  -e MYSQL_ROOT_PASSWORD=1234567890 -e MYSQL_DATABASE=appdb \
  -e MYSQL_USER=dbuser -e MYSQL_PASSWORD=123456 \
  --name lemp -d adhocore/lemp:8.2
  # for postgres you can pass in similar env as for mysql but with PGSQL_ prefix
```

After running container as above, you will be able to browse [localhost:8080](http://localhost:8080)!

The database adminerevo will be available for [mysql](http://localhost:8080/adminerevo?server=127.0.0.1%3A3306&username=root)
and [postgres](http://localhost:8080/adminerevo?pgsql=127.0.0.1%3A5432&username=postgres).

The mailcatcher will be available at [localhost:8888](http://localhost:8888) which displays mails in realtime.

### Stop container

To stop the container, you would run:

```sh
docker stop lemp
```

### (Re)Start container

You dont have to always do `docker run` as in above unless you removed or lost your `lemp` container.

Instead, you can just start when needed:

```sh
docker start lemp
```

> **PRO** If you develop multiple apps, you can create multiple lemp containers with different names.
>
> eg: `docker run -p 8081:80 -v $(pwd):/var/www/html --name new-lemp -d adhocore/lemp:8.3`


## With Docker compose

Create a `docker-compose.yml` in your project root with contents something similar to:

```yaml
# ./docker-compose.yml
version: '3'

services:
  app:
    image: adhocore/lemp:8.3
    # For different app you can use different names. (eg: )
    container_name: some-app
    volumes:
      # app source code
      - ./path/to/your/app:/var/www/html
      # db data persistence
      - db_data:/var/lib/mysql
      # Here you can also volume php ini settings
      # - /path/to/zz-overrides:/usr/local/etc/php/conf.d/zz-overrides.ini
    ports:
      - 8080:80
    environment:
      MYSQL_ROOT_PASSWORD: supersecurepwd
      MYSQL_DATABASE: appdb
      MYSQL_USER: dbusr
      MYSQL_PASSWORD: securepwd
      # for postgres you can pass in similar env as for mysql but with PGSQL_ prefix

volumes:
  db_data: {}
```

Then all you gotta do is:

```sh
# To start
docker-compose up -d

# To stop
docker-compose stop
```

As you can see using compose is very neat, intuitive and easy.
Plus you can already set the volumes and ports there, so you dont have to type in terminal.

### MySQL Default credentials

- **root password**: 1234567890 (if `MYSQL_ROOT_PASSWORD` is not passed)
- **user password**: 123456 (if `MYSQL_USER` is passed but `MYSQL_PASSWORD` is not)

### PgSQL Default credentials

- **postgres password**: 1234567890 (if `PGSQL_ROOT_PASSWORD` is not passed)
- **user password**: 123456 (if `PGSQL_USER` is passed but `PGSQL_PASSWORD` is not)


#### Accessing DB

In PHP app you can access MySQL db via PDO like so:
```php
$db = new PDO(
    'mysql:host=127.0.0.1;port=3306;dbname=' . getenv('MYSQL_DATABASE'),
    getenv('MYSQL_USER'),
    getenv('MYSQL_PASSWORD')
);
```

You can access PgSQL db via PDO like so:
```php
$pdb = new PDO(
    'pgsql:host=127.0.0.1;port=5432;dbname=' . getenv('PGSQL_DATABASE'),
    getenv('PGSQL_USER'),
    getenv('PGSQL_PASSWORD')
);
```

### Nginx

URL rewrite is already enabled for you.

Either your app has `public/` folder or not, the rewrite adapts automatically.

### PHP

For available extensions, check [adhocore/phpfpm#extensions](https://github.com/adhocore/docker-phpfpm#extensions).

### Disabling services

[Pass in env var](https://www.cloudsavvyit.com/14081/how-to-pass-environment-variables-to-docker-containers/)
`DISABLE` to the container in CSV format to disable services.
The service names must be one or more of below in comma separated format:
```
beanstalkd
mailcatcher
memcached
mysql
pgsql
redis
```

> Example: `DISABLE=beanstalkd,mailcatcher,memcached,pgsql,redis`
> Essential services like `nginx`, `php`, `adminerevo` cannot be disabled ;).

The 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.

### Testing mailcatcher

```sh
# open shell
docker exec -it lemp sh

# send test mail
echo "\n" | sendmail -S 0 test@localhost
```

Then you will see the new mail in realtime at http://localhost:8888.

Or you can check it in shell as well:
```sh

curl 0:88/messages
```


================================================
FILE: beanstalkd/beanstalkd.ini
================================================
[program:beanstalkd]
command=beanstalkd
autostart=true
autorestart=true
priority=7
startretries=3
stopwaitsecs=10
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0


================================================
FILE: docker-entrypoint.sh
================================================
#!/bin/sh

MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD:-1234567890}
MYSQL_PASSWORD=${MYSQL_PASSWORD:-123456}

PGSQL_ROOT_PASSWORD=${PGSQL_ROOT_PASSWORD:-1234567890}
PGSQL_PASSWORD=${PGSQL_PASSWORD:-123456}

DISABLE=",$DISABLE,"

for S in beanstalkd elasticsearch mailcatcher memcached mysql pgsql rabbitmq redis; do
  DS=$(echo $DISABLE | grep -q ",$S," && echo "YES"  || echo "NO")
  if [ "$DS" == "YES" ]; then
    if [[ -f "/etc/supervisor.d/$S.ini" ]]; then mv "/etc/supervisor.d/$S.ini" "/etc/supervisor.d/$S"; fi
  else
    if [[ -f "/etc/supervisor.d/$S" ]]; then mv "/etc/supervisor.d/$S" "/etc/supervisor.d/$S.ini"; fi
  fi
done

DISABLE_MYSQL=$(echo $DISABLE | grep -q ",mysql," && echo "YES"  || echo "NO")
DISABLE_PGSQL=$(echo $DISABLE | grep -q ",pgsql," && echo "YES"  || echo "NO")

# init nginx
if [ ! -d "/var/tmp/nginx/client_body" ]; then
  mkdir -p /run/nginx /var/tmp/nginx/client_body
  chown nginx:nginx -R /run/nginx /var/tmp/nginx/
fi

# init mysql
if [ "$DISABLE_MYSQL" != "YES" ] && [ ! -f "/run/mysqld/.init" ]; then
  [[ "$MYSQL_USER" = "root" ]] && echo "Please set MYSQL_USER other than root" && exit 1

  SQL=$(mktemp)

  mkdir -p /run/mysqld /var/lib/mysql
  chown mysql:mysql -R /run/mysqld /var/lib/mysql
  sed -i -e 's/skip-networking/skip-networking=0/' /etc/my.cnf.d/mariadb-server.cnf
  mysql_install_db --user=mysql --datadir=/var/lib/mysql

  if [ -n "$MYSQL_DATABASE" ]; then
    echo "CREATE DATABASE IF NOT EXISTS $MYSQL_DATABASE CHARACTER SET utf8 COLLATE utf8_general_ci;" >> $SQL
  fi

  MYSQL_DATABASE=${MYSQL_DATABASE:-*}

  if [ -n "MYSQL_USER" ]; then
    echo "GRANT ALL ON $MYSQL_DATABASE.* to '$MYSQL_USER'@'localhost' IDENTIFIED BY '$MYSQL_PASSWORD';" >> $SQL
    echo "GRANT ALL ON $MYSQL_DATABASE.* to '$MYSQL_USER'@'127.0.0.1' IDENTIFIED BY '$MYSQL_PASSWORD';" >> $SQL
    echo "GRANT ALL ON $MYSQL_DATABASE.* to '$MYSQL_USER'@'::1' IDENTIFIED BY '$MYSQL_PASSWORD';" >> $SQL
  fi

  echo "ALTER user 'root'@'localhost' IDENTIFIED BY '$MYSQL_ROOT_PASSWORD';" >> $SQL
  echo "DELETE FROM mysql.user WHERE User = '' OR Password = '';" >> $SQL
  echo "FLUSH PRIVILEGES;" >> $SQL

  cat "$SQL" | mysqld --user=mysql --bootstrap --silent-startup --skip-grant-tables=FALSE

  rm -rf ~/.mysql_history ~/.ash_history $SQL
  touch /run/mysqld/.init
fi

# init pgsql
if [ "$DISABLE_PGSQL" != "YES" ] && [ ! -f /run/postgresql/.init ]; then
  [[ "$PGSQL_USER" = "postgres" ]] && echo "Please set PGSQL_USER other than postgres" && exit 1

  SQL=$(mktemp)

  mkdir -p /run/postgresql /usr/local/pgsql/data
  chown postgres:postgres -R /run/postgresql /usr/local/pgsql/data
  su postgres -c "initdb -D /usr/local/pgsql/data"

  PGSQL_DATABASE=${PGSQL_DATABASE:-test}
  echo "CREATE DATABASE $PGSQL_DATABASE;" >> $SQL
  echo "ALTER USER postgres PASSWORD '$PGSQL_ROOT_PASSWORD';" >> $SQL
  if [ -n "$PGSQL_USER" ]; then
    echo "CREATE USER $PGSQL_USER WITH ENCRYPTED PASSWORD '$PGSQL_PASSWORD';" >> $SQL
    echo "GRANT ALL PRIVILEGES ON DATABASE $PGSQL_DATABASE TO $PGSQL_USER;" >> $SQL
  fi
  echo "GRANT ALL PRIVILEGES ON DATABASE $PGSQL_DATABASE TO postgres;" >> $SQL

  su postgres -c "pg_ctl -D '/usr/local/pgsql/data' -o '-c listen_addresses='' -p ${PGSQL_PORT:-5432}' -w start"
  su -c "psql --username=postgres --file='$SQL'"
  rm -rf ~/.psql_history ~/.ash_history $SQL
  su postgres -c "pg_ctl -D '/usr/local/pgsql/data' -m fast -w stop"
  sed -i -E 's/host\s+all(.*)trust/host    all\1password/' /usr/local/pgsql/data/pg_hba.conf
  touch /run/postgresql/.init
fi

exec "$@"


================================================
FILE: elasticsearch/elasticsearch.ini
================================================
[program:elasticsearch]
command=su elastico -c "elasticsearch"
autostart=true
autorestart=true
priority=8
startretries=3
stopwaitsecs=10
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0


================================================
FILE: mailcatcher/mailcatcher.ini
================================================
[program:mailcatcher]
command=mailcatcher --foreground --ip=0.0.0.0 --smtp-port=25 --http-port=88
autostart=true
autorestart=true
priority=5
startretries=3
stopwaitsecs=10
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0


================================================
FILE: memcached/memcached.ini
================================================
[program:memcached]
command=memcached -u memcached
autostart=true
autorestart=true
priority=5
startretries=3
stopwaitsecs=10
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0


================================================
FILE: mysql/mysql.ini
================================================
# for supervisord
[program:mysqld]
command=mysqld --user=mysql
autostart=true
autorestart=true
priority=1
startretries=3
stopwaitsecs=10
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0


================================================
FILE: nginx/conf.d/default.conf
================================================
server {
  listen 80;
  listen [::]:80 ipv6only=on default_server;
  server_name _;

  index index.php index.html index.htm;

  set $docroot "html";
  if (-d "/var/www/html/public") {
    set $docroot "html/public";
  }
  if ($request_filename ~ /(adminerevo|adminer)/) {
    set $docroot "adminerevo";
  }

  root "/var/www/${docroot}";

  if (!-e $request_filename) {
    rewrite ^.*$ /index.php last;
  }

  location ~ \.php$ {
    fastcgi_pass 0.0.0.0:9000;
    fastcgi_index index.php;
    fastcgi_split_path_info ^(.+\.php)(/.+)$;
    fastcgi_param PATH_INFO $fastcgi_path_info;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    fastcgi_buffers 16 16k;
    fastcgi_buffer_size 32k;
    include fastcgi_params;
  }

  location ~ /\.ht {
    deny all;
  }
}


================================================
FILE: nginx/nginx.conf
================================================
user  nginx;
daemon  off;
worker_processes  10;

# error_log  /var/log/nginx/error.log warn;
pid  /var/run/nginx.pid;

events {
  worker_connections  1024;
}

http {
  include  /etc/nginx/mime.types;
  default_type  application/octet-stream;

  log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
    '$status $body_bytes_sent "$http_referer" '
    '"$http_user_agent" "$http_x_forwarded_for"';

  sendfile  on;
  tcp_nopush  on;

  keepalive_timeout  65;

  # gzip  on;

  include /etc/nginx/conf.d/*.conf;
}


================================================
FILE: nginx/nginx.ini
================================================
# for supervisord
[program:nginx]
command=nginx -c /etc/nginx/nginx.conf
autostart=true
autorestart=true
priority=3
startretries=3
stopwaitsecs=10
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0


================================================
FILE: pgsql/pgsql.ini
================================================
# for supervisord
[program:postgres]
command=su postgres -c "postgres -D /usr/local/pgsql/data"
autostart=true
autorestart=true
priority=4
startretries=3
stopwaitsecs=10
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0


================================================
FILE: php/index.php
================================================
<?php

$works = "<p>If you see this, that means it works!</p>\n\n";
echo PHP_SAPI == 'cli' ? strip_tags($works) : $works;

$mdb = new PDO(
    'mysql:host=127.0.0.1;port=3306;dbname=' . (getenv('MYSQL_DATABASE') ?: 'test'),
    getenv('MYSQL_USER') ?: 'root',
    getenv('MYSQL_PASSWORD') ?: '1234567890'
);

$pdb = new PDO(
    'pgsql:host=127.0.0.1;port=5432;dbname=' . (getenv('PGSQL_DATABASE') ?: 'postgres'),
    getenv('PGSQL_USER') ?: 'postgres',
    getenv('PGSQL_PASSWORD') ?: '1234567890'
);

if (PHP_SAPI !== 'cli') echo "<pre>\n";

echo 'MySQL NOW(): ', $mdb->query('SELECT NOW()')->fetchColumn() . "\n";
echo 'PgSQL NOW(): ', $pdb->query('SELECT NOW()')->fetchColumn() . "\n\n";
echo 'PHP: ', phpversion(), "\n\n";

$extensions = get_loaded_extensions();
$extensions = array_map('strtolower', $extensions);

echo "Extensions: ", count($extensions), "\n\n";

sort($extensions);
foreach (array_chunk($extensions, 4) as $exts) {
    foreach ($exts as $ext) {
        echo '- ' . str_pad($ext, 18, ' ', STR_PAD_RIGHT);
    }
    echo "\n";
}

echo PHP_SAPI === 'cli'
    ? "\nSource code: https://github.com/adhocore/docker-lemp\n\n"
    : "</pre>\n\n"
        . 'Source code: <a href="https://github.com/adhocore/docker-lemp" target="_blank">adhocore/docker-lemp</a>'
        . ' | Adminerevo: <a href="/adminerevo?server=127.0.0.1%3A3306&username=root" target="_blank">mysql</a>, '
        . ' <a href="/adminerevo?pgsql=127.0.0.1%3A5432&username=postgres" target="_blank">postgres</a>'
        . "\n";


================================================
FILE: php/php-fpm.ini
================================================
# for supervisord
[program:php-fpm]
command=php-fpm --nodaemonize --fpm-config /usr/local/etc/php-fpm.conf
autostart=true
autorestart=true
priority=2
startretries=3
stopwaitsecs=10
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0


================================================
FILE: rabbitmq/rabbitmq.ini
================================================
[program:rabbitmq-server]
command=rabbitmq-server
autostart=true
autorestart=true
priority=7
startretries=3
stopwaitsecs=10
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0


================================================
FILE: redis/redis.ini
================================================
[program:redis-server]
command=redis-server
autostart=true
autorestart=true
priority=6
startretries=3
stopwaitsecs=10
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
Download .txt
gitextract_cpq1w5vp/

├── .dockerignore
├── .editorconfig
├── .github/
│   ├── FUNDING.yml
│   └── workflows/
│       ├── build.yml
│       ├── build_manual.yml
│       └── build_preview.yml
├── .gitignore
├── 7.4.Dockerfile
├── 8.0.Dockerfile
├── 8.1.Dockerfile
├── 8.2.Dockerfile
├── 8.3.Dockerfile
├── LICENSE
├── README.md
├── beanstalkd/
│   └── beanstalkd.ini
├── docker-entrypoint.sh
├── elasticsearch/
│   └── elasticsearch.ini
├── mailcatcher/
│   └── mailcatcher.ini
├── memcached/
│   └── memcached.ini
├── mysql/
│   └── mysql.ini
├── nginx/
│   ├── conf.d/
│   │   └── default.conf
│   ├── nginx.conf
│   └── nginx.ini
├── pgsql/
│   └── pgsql.ini
├── php/
│   ├── index.php
│   └── php-fpm.ini
├── rabbitmq/
│   └── rabbitmq.ini
└── redis/
    └── redis.ini
Condensed preview — 28 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (41K chars).
[
  {
    "path": ".dockerignore",
    "chars": 67,
    "preview": ".git\n.github\n.gitignore\n.editorconfig\ndocker-compose.yml\nREADME.md\n"
  },
  {
    "path": ".editorconfig",
    "chars": 339,
    "preview": "; http://editorconfig.org\n;\n; Sublime: https://github.com/sindresorhus/editorconfig-sublime\n; Phpstorm: https://plugins."
  },
  {
    "path": ".github/FUNDING.yml",
    "chars": 52,
    "preview": "github: adhocore\ncustom: ['https://paypal.me/ji10']\n"
  },
  {
    "path": ".github/workflows/build.yml",
    "chars": 4164,
    "preview": "name: build\n\non:\n  workflow_dispatch:\n  push:\n    branches:\n      - 'main'\n\njobs:\n  docker:\n    runs-on: ubuntu-latest\n "
  },
  {
    "path": ".github/workflows/build_manual.yml",
    "chars": 1433,
    "preview": "name: build_manual\n\non:\n  workflow_dispatch:\n\njobs:\n  docker:\n    runs-on: ubuntu-latest\n    steps:\n      - name: Checko"
  },
  {
    "path": ".github/workflows/build_preview.yml",
    "chars": 1425,
    "preview": "name: build_preview\n\non:\n  workflow_dispatch:\n\njobs:\n  docker:\n    runs-on: ubuntu-latest\n    steps:\n      - name: Check"
  },
  {
    "path": ".gitignore",
    "chars": 39,
    "preview": "docker-compose.yml\ndocker-project.json\n"
  },
  {
    "path": "7.4.Dockerfile",
    "chars": 2513,
    "preview": "FROM adhocore/phpfpm:7.4\n\nMAINTAINER Jitendra Adhikari <jiten.adhikary@gmail.com>\n\nENV \\\n  ADMINEREVO_VERSION=4.8.4 \\\n  "
  },
  {
    "path": "8.0.Dockerfile",
    "chars": 2533,
    "preview": "FROM adhocore/phpfpm:8.0\n\nMAINTAINER Jitendra Adhikari <jiten.adhikary@gmail.com>\n\nENV \\\n  ADMINEREVO_VERSION=4.8.4 \\\n  "
  },
  {
    "path": "8.1.Dockerfile",
    "chars": 2479,
    "preview": "FROM adhocore/phpfpm:8.1\n\nMAINTAINER Jitendra Adhikari <jiten.adhikary@gmail.com>\n\nENV \\\n  ADMINEREVO_VERSION=4.8.4 \\\n  "
  },
  {
    "path": "8.2.Dockerfile",
    "chars": 2479,
    "preview": "FROM adhocore/phpfpm:8.2\n\nMAINTAINER Jitendra Adhikari <jiten.adhikary@gmail.com>\n\nENV \\\n  ADMINEREVO_VERSION=4.8.4 \\\n  "
  },
  {
    "path": "8.3.Dockerfile",
    "chars": 2457,
    "preview": "FROM adhocore/phpfpm:8.3a\n\nMAINTAINER Jitendra Adhikari <jiten.adhikary@gmail.com>\n\nENV \\\n  ADMINEREVO_VERSION=4.8.4 \\\n "
  },
  {
    "path": "LICENSE",
    "chars": 1074,
    "preview": "MIT License\n\nCopyright (c) 2019 Jitendra Adhikari\n\nPermission is hereby granted, free of charge, to any person obtaining"
  },
  {
    "path": "README.md",
    "chars": 7834,
    "preview": "## docker-lemp\n\n[![Docker build](https://github.com/adhocore/docker-lemp/actions/workflows/build.yml/badge.svg)](https:/"
  },
  {
    "path": "beanstalkd/beanstalkd.ini",
    "chars": 220,
    "preview": "[program:beanstalkd]\ncommand=beanstalkd\nautostart=true\nautorestart=true\npriority=7\nstartretries=3\nstopwaitsecs=10\nstdout"
  },
  {
    "path": "docker-entrypoint.sh",
    "chars": 3529,
    "preview": "#!/bin/sh\n\nMYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD:-1234567890}\nMYSQL_PASSWORD=${MYSQL_PASSWORD:-123456}\n\nPGSQL_ROOT_P"
  },
  {
    "path": "elasticsearch/elasticsearch.ini",
    "chars": 243,
    "preview": "[program:elasticsearch]\ncommand=su elastico -c \"elasticsearch\"\nautostart=true\nautorestart=true\npriority=8\nstartretries=3"
  },
  {
    "path": "mailcatcher/mailcatcher.ini",
    "chars": 278,
    "preview": "[program:mailcatcher]\ncommand=mailcatcher --foreground --ip=0.0.0.0 --smtp-port=25 --http-port=88\nautostart=true\nautores"
  },
  {
    "path": "memcached/memcached.ini",
    "chars": 231,
    "preview": "[program:memcached]\ncommand=memcached -u memcached\nautostart=true\nautorestart=true\npriority=5\nstartretries=3\nstopwaitsec"
  },
  {
    "path": "mysql/mysql.ini",
    "chars": 243,
    "preview": "# for supervisord\n[program:mysqld]\ncommand=mysqld --user=mysql\nautostart=true\nautorestart=true\npriority=1\nstartretries=3"
  },
  {
    "path": "nginx/conf.d/default.conf",
    "chars": 786,
    "preview": "server {\n  listen 80;\n  listen [::]:80 ipv6only=on default_server;\n  server_name _;\n\n  index index.php index.html index."
  },
  {
    "path": "nginx/nginx.conf",
    "chars": 532,
    "preview": "user  nginx;\ndaemon  off;\nworker_processes  10;\n\n# error_log  /var/log/nginx/error.log warn;\npid  /var/run/nginx.pid;\n\ne"
  },
  {
    "path": "nginx/nginx.ini",
    "chars": 253,
    "preview": "# for supervisord\n[program:nginx]\ncommand=nginx -c /etc/nginx/nginx.conf\nautostart=true\nautorestart=true\npriority=3\nstar"
  },
  {
    "path": "pgsql/pgsql.ini",
    "chars": 276,
    "preview": "# for supervisord\n[program:postgres]\ncommand=su postgres -c \"postgres -D /usr/local/pgsql/data\"\nautostart=true\nautoresta"
  },
  {
    "path": "php/index.php",
    "chars": 1514,
    "preview": "<?php\n\n$works = \"<p>If you see this, that means it works!</p>\\n\\n\";\necho PHP_SAPI == 'cli' ? strip_tags($works) : $works"
  },
  {
    "path": "php/php-fpm.ini",
    "chars": 287,
    "preview": "# for supervisord\n[program:php-fpm]\ncommand=php-fpm --nodaemonize --fpm-config /usr/local/etc/php-fpm.conf\nautostart=tru"
  },
  {
    "path": "rabbitmq/rabbitmq.ini",
    "chars": 230,
    "preview": "[program:rabbitmq-server]\ncommand=rabbitmq-server\nautostart=true\nautorestart=true\npriority=7\nstartretries=3\nstopwaitsecs"
  },
  {
    "path": "redis/redis.ini",
    "chars": 224,
    "preview": "[program:redis-server]\ncommand=redis-server\nautostart=true\nautorestart=true\npriority=6\nstartretries=3\nstopwaitsecs=10\nst"
  }
]

About this extraction

This page contains the full source code of the adhocore/docker-lemp GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 28 files (36.8 KB), approximately 12.6k tokens. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!