adhocore / docker-lemp

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
https://hub.docker.com/r/adhocore/lemp
MIT License
153 stars 40 forks source link

Add an entry point to populate the mysql database on start #35

Open pixeline opened 2 years ago

pixeline commented 2 years ago

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.

adhocore commented 2 years ago

thank you. :) that's not already supported. we can try to copy that behavior though which needs some changes in https://github.com/adhocore/docker-lemp/blob/main/docker-entrypoint.sh#L30-L60 if you are interested

and for postgres in https://github.com/adhocore/docker-lemp/blob/main/docker-entrypoint.sh#L30-L60


i would say we should support only *.sql files (in sorted order) from *initdb.d/