giandonatoinverso / PHP-Dynamic-Qr-code

PHP Dynamic Qr code is a script that allows the generation and saving of dynamic and static QR codes
MIT License
268 stars 76 forks source link

Docker Setup questions #110

Closed lcx closed 4 months ago

lcx commented 4 months ago

Hi, thanks for this project. While setting it up I noticed a few things, I can contribute with a PR if you want, just wanted to clarify first if I might be missing something.

Is there a reason you are using giandonatoinverso/php-dynamic-qr-code-db instead of directly using mysql:8?

Having the database port open might not be a good idea, especially how we all are lazy and will of course not change the default password.

    ports:
      - '13306:3306'

This should be enough for the database to work and services in the compose can connect to the DB without requiring to open up the ports to the public.

  db:
    image: "mysql:8"
    restart: "unless-stopped"
    volumes:
      - /opt/docker/qr.interface-wien.at/db:/var/lib/mysql
    environment:
      MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
      MYSQL_DATABASE: "qrcode"
      MYSQL_USER: "qrcode"
      MYSQL_PASSWORD: ${MYSQL_PASSWORD}
    networks:
      - php-dynamic-qrcode-network
lcx commented 4 months ago

oh .... just probably answered my question ...

COPY /app/sample_data.sql /docker-entrypoint-initdb.d/init.sql # buildkit