GithubHelp home page GithubHelp logo

adhocore / docker-lemp Goto Github PK

View Code? Open in Web Editor NEW
150.0 7.0 40.0 153 KB

A single container LEMP complete fullstack with latest release of PHP8.0.30/8.1.27/8.2.17/8.3.4, MySQL, nginx, PostgreSQL, mailcatcher, beanstalkd, elasticsearch, memcached, redis, adminer and all you ever need; on top alpine3.17+ for both arm and amd arch

Home Page: https://hub.docker.com/r/adhocore/lemp

License: MIT License

Dockerfile 71.04% Shell 20.30% PHP 8.66%
docker local-development lemp docker-lemp mysql nginx alpine-linux mailcatcher phpfpm postgres

docker-lemp's Introduction

Hi there πŸ‘‹

Jitendra's github stats

Stats ranks: S (top 1%), A+ (12.5%), A (25%), A- (37.5%), B+ (50%)

Top Lang's GitHub Streak

πŸ”– View the badges I unlocked in GitHub and holopin.


If you love OpenSource, understand the value of it and appreciate the idea of how developers provide & maintain free & open source softwares, tools & libraries that take significant effort, please consider supporting me, thank you. ☺️

docker-lemp's People

Contributors

achillesjr avatar adhocore avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

docker-lemp's Issues

Add an entry point to populate the mysql database on start

Hi!

I would like that on starting the container, if it finds an SQL file in a specific folder, it runs it.
Usually, when using official mariadb / mysql images, I do it by having this volume in my docker-compose for the db service:

volumes:
      - "./data/dumps:/docker-entrypoint-initdb.d"

I tried exactly that with adhocore/docker-lemp:8.0 and it does not seem to work. Is there a way to do that?
Thank you!
Alex.

Cannot access index.php

Hi,

I am new to docker, but I have successfully setup this container and I see the following page when I visit localhost:8080
image

I cannot figure out how to redirect this page to my index.php...

I have a docker-compose.yml file in my laravel project like so:

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

services:
  app:
    image: adhocore/lemp:7.4
    # For different app you can use different names. (eg: )
    container_name: testapp
    volumes:
      - 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: password
      MYSQL_DATABASE: testapp
      MYSQL_USER: admin
      MYSQL_PASSWORD: password
      # for postgres you can pass in similar env as for mysql but with PGSQL_ prefix

volumes:
  db_data: {}

My project folder structure is:
image

Question to gd extension (JPEG and FreeType support)

Hello,
nice work first of all! This image/container is just replacing XAMPP on my development environment.
One thing I did not get running fully was the GD extension.

Basically I want to achieve that phpinfo() returns in the gd section the following entries, which it does not yet:
FreeType Support => enabled
FreeType Linkage => with freetype
FreeType Version => x.x.x
JPEG Support => enabled
libJPEG Version => 9 compatible

How can I achieve this?
(I need to work with JPG images in my project, to add a watermark to an uploaded jpg image and save it.)

Thanks in advance

Need apt-get and pdftotext

Hey there, Can we enable the apt-get option into this image, and with that, I can install the library pdftotext ?

Suggestion: Rename folder php to `webapp` or `project` or similar

When I try to containerize my own project I have to store in a different place the php-fpm.ini that is inside the php folder , delete the index.php, copy my code into the php folder and add back the php-fpm.ini, I feel like the structure should be more like:

root 
       --- php 
             --- php-fpm.ini
       --- webapp
             --- index.php (or the files of the project to be containerized) 

In this structure we keep the php config files in a different location than the php code files.

so that in the Dockerfiles we can copy all the files inside the project folder, so instead of

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

we can do something like

COPY ./php/. /var/www/html/

to copy all the files

ARM SUPPORT

Hoping to support linux/arm64/v8

like RPI 4 or arm base devices

Unable to connect to MYSQL

Hello,

I am unable to connect to the MYSQL server when trying to migrate for example in my Laravel application.
I can connect to MYSQL through the container CLI using the same credentials.

Also, a secondary issue is Mailcatcher, there is nothing when I try to reach http://localhost:8888/ (localhost refused connection)

.env

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=app
DB_USERNAME=admin
DB_PASSWORD=password

docker-compose.yml

version: '3'

services:
  app:
    image: adhocore/lemp:7.4
    container_name: app
    volumes:
      - db_data:/var/lib/mysql
      - .:/var/www/html
    ports:
      - 8080:80
    environment:
      MYSQL_ROOT_PASSWORD: password
      MYSQL_DATABASE: app
      MYSQL_USER: admin
      MYSQL_PASSWORD: password

volumes:
  db_data: {}

Connecting to MYSQL via container CLI using same credentials:

image

Error running migrate:

$ php artisan migrate

Illuminate\Database\QueryException
SQLSTATE[HY000] [2002] Connection refused (SQL: select * from information_schema.tables where table_schema = app and table_name = migrations and table_type = 'BASE TABLE')

Advice on usage

Hello!

Say I want to deploy in this docker image a repo I have hosted somewhere, what would you recommend ?

  • git clone from inside the nginx image, or;
  • cloning outside of the docker image and linking the folder to the nginx public directory?

Copy Application into container

Sometimes a full containerized app needs to be created to easily ship to a service or to give to someone for testing, how to achieve this? The only way I found is to add this line to the Dockerfile:

# Copy source code
COPY --chown=www-data:www-data . /var/www/html

Docker compose setup

Hi!
I get errors like:
[08001] Could not create connection to database server. Attempted reconnect 3 times. Giving up. [HY000][1130] null, message from server: "Host '172.18.0.1' is not allowed to connect to this MariaDB server".
[Warning] Aborted connection 10 to db: 'unconnected' user: 'unauthenticated' host: '172.18.0.1' (This connection closed normally without authentication)

How to configure docker compose file ?

Docker compose setup

Hi!
#14
Continuing, I would like to ask you to specify other ports by analogy. Can I forward other ports as well?

adhocore/lemp:8.1 cannot find command 'php-fpm'

Hi,

I run this command using docker image adhocore/lemp:8.1

docker run -p 8080:80 -p 8888:88 -v `pwd`:/var/www/html \
  -e MYSQL_ROOT_PASSWORD=123 -e MYSQL_DATABASE=db \
  -e MYSQL_USER=user -e MYSQL_PASSWORD=123 \
  --name lemp --platform linux/amd64 -d adhocore/lemp:8.1

docker container cannot run PHP file. What I saw in the log of container

2022-06-07 05:23:07,729 INFO spawnerr: can't find command 'php-fpm'
2022-06-07 05:23:04,705 INFO spawnerr: can't find command 'php-fpm'
2022-06-07 05:23:07,730 INFO gave up: php-fpm entered FATAL state, too many start retries too quickly

if I type

# which php-fpm

it returns nothing. It is likely that php-fpm is failed to installed.

If I use docker image adhocore/lemp:8.0 then it works.

docker run -p 8080:80 -p 8888:88 -v `pwd`:/var/www/html \
  -e MYSQL_ROOT_PASSWORD=123 -e MYSQL_DATABASE=db \
  -e MYSQL_USER=user -e MYSQL_PASSWORD=123 \
  --name lemp --platform linux/amd64 -d adhocore/lemp:8.0

if I type

# which php-fpm
/usr/local/sbin/php-fpm

My environment

  • Apple Mac M1 Pro
  • Docker Engine: 20.10.16,

What about Phalcon?

Sorry if not the place, but... What about Phalcon? Can be included somehow?

Thank you!

RabbitMQ

Hi!

Could you please add RabbitMQ? It is very often needed.

php8

Hi!
I think it's great to add php 8

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.