Giter Club home page Giter Club logo

docker-nginx-php-laravel's People

Contributors

dimadeush 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

docker-nginx-php-laravel's Issues

can't connect to the database

I have a problem in the server when I wanna connect database it says for example
SQLSTATE[HY000] [1045] Access denied for user 'database'@'111.111.112.4'

but my IP has changed and now is 111.111.112.1
How can I fix this problem?

Unable to start MySQL 8 container

Greetings gentlemen!

I followed the step to step guide to set up the dev environment on my local, which is:

  1. Windows OS
  2. WSL 2 Ubuntu 22.04

Everything was okay, free of errors until I ran make start.

All the containers are running, then in 3 seconds, the MySQL container stopped.

image

The error message basically says the table is not there and I should upgrade MySQL. I searched online there are some answers said to bash into MySQL then upgrade, but I can' t bash into it if it is not running.

[ERROR] [MY-010735] [Server] Could not open the mysql.plugin table. Please perform the MySQL upgrade procedure.

What should I do? Thanks for your time! Full output below:

2023-03-20 09:07:46 2023-03-19T22:07:46.008652Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.22) starting as process 1
2023-03-20 09:07:46 2023-03-19T22:07:46.012906Z 0 [Warning] [MY-010159] [Server] Setting lower_case_table_names=2 because file system for /var/lib/mysql/ is case insensitive
2023-03-20 09:07:46 2023-03-19T22:07:46.024971Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2023-03-20 09:07:46 2023-03-19T22:07:46.508481Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2023-03-20 09:07:46 mysqld: Table 'mysql.plugin' doesn't exist
2023-03-20 09:07:46 2023-03-19T22:07:46.589252Z 0 [ERROR] [MY-010735] [Server] Could not open the mysql.plugin table. Please perform the MySQL upgrade procedure.
2023-03-20 09:07:46 2023-03-19T22:07:46.593150Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Bind-address: '::' port: 33060, socket: /var/run/mysqld/mysqlx.sock
2023-03-20 09:07:46 2023-03-19T22:07:46.617007Z 0 [Warning] [MY-010015] [Repl] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2023-03-20 09:07:46 2023-03-19T22:07:46.669005Z 0 [Warning] [MY-000054] [Server] World-writable config file './auto.cnf' is ignored.
2023-03-20 09:07:46 2023-03-19T22:07:46.670086Z 0 [Warning] [MY-010107] [Server] World-writable config file './auto.cnf' has been removed.
2023-03-20 09:07:46 2023-03-19T22:07:46.670584Z 0 [Warning] [MY-010075] [Server] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: 7addb6cb-c6a2-11ed-8124-0242ac1f0002.
2023-03-20 09:07:46 2023-03-19T22:07:46.691036Z 0 [Warning] [MY-010015] [Repl] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2023-03-20 09:07:46 2023-03-19T22:07:46.696229Z 0 [Warning] [MY-013595] [Server] Failed to initialize TLS for channel: mysql_main. See below for the description of exact issue.
2023-03-20 09:07:46 2023-03-19T22:07:46.696372Z 0 [Warning] [MY-010069] [Server] Failed to set up SSL because of the following SSL library error: SSL context is not usable without certificate and private key
2023-03-20 09:07:46 2023-03-19T22:07:46.698509Z 0 [Warning] [MY-010284] [Server] RSA public key file not found: /var/lib/mysql//public_key.pem. Some authentication plugins will not work.
2023-03-20 09:07:46 2023-03-19T22:07:46.699673Z 0 [Warning] [MY-010284] [Server] RSA public key file not found: /var/lib/mysql//public_key.pem. Some authentication plugins will not work.
2023-03-20 09:07:46 2023-03-19T22:07:46.702769Z 0 [Warning] [MY-011810] [Server] Insecure configuration for --pid-file: Location '/var/run/mysqld' in the path is accessible to all OS users. Consider choosing a different directory.
2023-03-20 09:07:46 2023-03-19T22:07:46.703131Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables
2023-03-20 09:07:46 2023-03-19T22:07:46.703383Z 0 [ERROR] [MY-013129] [Server] A message intended for a client cannot be sent there as no client-session is attached. Therefore, we're sending the information to the error-log instead: MY-001146 - Table 'mysql.component' doesn't exist
2023-03-20 09:07:46 2023-03-19T22:07:46.703527Z 0 [Warning] [MY-013129] [Server] A message intended for a client cannot be sent there as no client-session is attached. Therefore, we're sending the information to the error-log instead: MY-003543 - The mysql.component table is missing or has an incorrect definition.
2023-03-20 09:07:46 2023-03-19T22:07:46.703957Z 0 [ERROR] [MY-010326] [Server] Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist
2023-03-20 09:07:46 2023-03-19T22:07:46.704122Z 0 [ERROR] [MY-010952] [Server] The privilege system failed to initialize correctly. For complete instructions on how to upgrade MySQL to a new version please see the 'Upgrading MySQL' section from the MySQL manual.
2023-03-20 09:07:46 2023-03-19T22:07:46.704443Z 0 [ERROR] [MY-010119] [Server] Aborting
2023-03-20 09:07:48 2023-03-19T22:07:48.165181Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.22)  MySQL Community Server - GPL.
2023-03-20 09:07:45 2023-03-19 22:07:45+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.22-1debian10 started.
2023-03-20 09:07:45 2023-03-19 22:07:45+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
2023-03-20 09:07:45 2023-03-19 22:07:45+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.22-1debian10 started.

Why we need to run composer install inside the docker file, if it will be overwritten with volumes.

Hello,
I am curious as to why we need to run composer install inside the Docker file if it will be overwritten with volumes.

when we build the docker this will run first

# copy source files and config file
COPY --chown=${USERNAME}:${USERNAME} . $APP_HOME/
COPY --chown=${USERNAME}:${USERNAME} .env.$ENV $APP_HOME/.env

# install all PHP dependencies
RUN if [ "$BUILD_ARGUMENT_ENV" = "dev" ] || [ "$BUILD_ARGUMENT_ENV" = "test" ]; then COMPOSER_MEMORY_LIMIT=-1 composer install --optimize-autoloader --no-interaction --no-progress; \
    else COMPOSER_MEMORY_LIMIT=-1 composer install --optimize-autoloader --no-interaction --no-progress --no-dev; \
    fi

and this will copy the local files and overwrite what we did in the previous step in the docker file
docker-compose-yaml
NGINX: volumes:
- .:/var/www/html:ro,cached
LARAVEL: volumes:
- .:/var/www/html:cached

How to add SSL cert?

I see in the nginx Dockerfile that it attempts to run openssl an generates a key.pem and cert.key with some default settings including the domain "example.cn".

I tried to modify this to my own domain.

After doing make start I checked and there's no directory /etc/nginx/certificates that the Dockerfile specifies. I can't find any certificate files.

How do we get it to generate the certificate?

I cant exec it

I have done all levels and I haven't reveiced any errors but I dont know how it will be going to exec?
I enter on my browser -> 127.0.0.1 or localhost but it doesnt execute

No Redis included?

I see that there is configuration for Redis in the .env files but Redis doesn't appear to be part of the package. Is there a simple way to add this? I've added the predis/predis composer package but I don't think that it's installed.

make migrate throws error in SQL

I just set this up and am following the directions. I'm getting an error when attempting to run make migrate. It's giving me this error:

SQLSTATE[HY000] [2002] No such file or directory (SQL: select * from information_schema.tables where table_schema = laravel and table_name = migrations and table_type = 'BASE TABLE')

I checked the information_schema database tables table and the row is in fact there. The migrations table is in fact in the database.

I can't seem to get past this. Any ideas?

I can connect to the database using my SequelAce app from my local system.

Files not copied over into container

Firstly, I'd like to say that I am using "docker compose" instead of "docker-compose" (I ammended the Makefile), I am not sure that is the problem though.
After I run make build && make start, all the containers start ok, however the only files that are copied over are docker/dev/init-db.sql and the storage/mysql-data folder, resulting in a 404 from nginx (i am guessing because of the missing files).
I am running Linux Ubuntu 22.04, Docker 4.17.0, docker compose v2.16.0.
Any ideas on how to solve this would be greatly appreciated, thanks!

unable to connect to dbbeaver

i can connect through terminal by using

mysql -h mysql -u root -psecret laravel

but when i try to connect to dbbeaver i get connection refused.

what is the issue?

cron job

Thank you dear friend for making this excellent project. I have used it and its so nice
I have a question . how we can use and write cron jobs when we have this structure. is it different with normal project?

Question: Domain name

How can I add a domain name? Which will not conflict with local machine 127.0.0.1. Thanks

error for nginx

Service 'nginx' failed to build: The command '/bin/sh -c apk add --update openssl && rm -rf /var/cache/apk/*' returned a non-zero code: 1

Composer:latest

Greetings gentlemen!

First of all, I would like to express my gratitude for the excellent repository.
I encountered the following issue:

If the Dockerfile configuration specifies
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
the "make build" command fails with an

error
 ERROR [stage-0 19/19] RUN if [ "dev" = "dev  0.5s
------                                                
 > [stage-0 19/19] RUN if [ "dev" = "dev" ] || [ "dev" = "test" ]; then COMPOSER_MEMORY_LIMIT=-1 composer install --optimize-autoloader --no-interaction --no-progress;     else COMPOSER_MEMORY_LIMIT=-1 composer install --optimize-autoloader --no-interaction --no-progress --no-dev;     fi:
0.372 PHP Fatal error:  Uncaught TypeError: array_merge(): Argument #1 must be of type array, bool given in phar:///usr/bin/composer/src/Composer/Config.php:191
0.372 Stack trace:
0.372 #0 phar:///usr/bin/composer/src/Composer/Config.php(191): array_merge(true, Array, true)
0.372 #1 phar:///usr/bin/composer/src/Composer/Factory.php(350): Composer\Config->merge(Array, './composer.json')
0.372 #2 phar:///usr/bin/composer/src/Composer/Factory.php(643): Composer\Factory->createComposer(Object(Composer\IO\ConsoleIO), Array, false, '/var/www/html', true, false)
0.372 #3 phar:///usr/bin/composer/src/Composer/Console/Application.php(445): Composer\Factory::create(Object(Composer\IO\ConsoleIO), NULL, false, false)
0.372 #4 phar:///usr/bin/composer/src/Composer/Command/BaseCommand.php(65): Composer\Console\Application->getComposer(false, false, false)
0.372 #5 phar:///usr/bin/composer/src/Composer/Command/BaseCommand.php(150): Composer\Command\BaseCommand->getComposer(false, false, false)
0.372 #6 phar:///usr/bin/composer/vendor/symfony/console/Command/Command.php(211): Composer\Command\BaseCommand->initialize(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
0.372 #7 phar:///usr/bin/composer/vendor/symfony/console/Application.php(835): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
0.372 #8 phar:///usr/bin/composer/vendor/symfony/console/Application.php(185): Symfony\Component\Console\Application->doRunCommand(Object(Composer\Command\InstallCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
0.372 #9 phar:///usr/bin/composer/src/Composer/Console/Application.php(336): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
0.372 #10 phar:///usr/bin/composer/vendor/symfony/console/Application.php(117): Composer\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
0.372 #11 phar:///usr/bin/composer/src/Composer/Console/Application.php(131): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
0.372 #12 phar:///usr/bin/composer/bin/composer(73): Composer\Console\Application->run()
0.372 #13 /usr/bin/composer(29): require('phar:///usr/bin...')
0.372 #14 {main}
0.372   thrown in phar:///usr/bin/composer/src/Composer/Config.php on line 191
0.372 
0.372 Fatal error: Uncaught TypeError: array_merge(): Argument #1 must be of type array, bool given in phar:///usr/bin/composer/src/Composer/Config.php:191
0.372 Stack trace:
0.372 #0 phar:///usr/bin/composer/src/Composer/Config.php(191): array_merge(true, Array, true)
0.372 #1 phar:///usr/bin/composer/src/Composer/Factory.php(350): Composer\Config->merge(Array, './composer.json')
0.372 #2 phar:///usr/bin/composer/src/Composer/Factory.php(643): Composer\Factory->createComposer(Object(Composer\IO\ConsoleIO), Array, false, '/var/www/html', true, false)
0.372 #3 phar:///usr/bin/composer/src/Composer/Console/Application.php(445): Composer\Factory::create(Object(Composer\IO\ConsoleIO), NULL, false, false)
0.372 #4 phar:///usr/bin/composer/src/Composer/Command/BaseCommand.php(65): Composer\Console\Application->getComposer(false, false, false)
0.372 #5 phar:///usr/bin/composer/src/Composer/Command/BaseCommand.php(150): Composer\Command\BaseCommand->getComposer(false, false, false)
0.372 #6 phar:///usr/bin/composer/vendor/symfony/console/Command/Command.php(211): Composer\Command\BaseCommand->initialize(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
0.372 #7 phar:///usr/bin/composer/vendor/symfony/console/Application.php(835): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
0.372 #8 phar:///usr/bin/composer/vendor/symfony/console/Application.php(185): Symfony\Component\Console\Application->doRunCommand(Object(Composer\Command\InstallCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
0.372 #9 phar:///usr/bin/composer/src/Composer/Console/Application.php(336): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
0.372 #10 phar:///usr/bin/composer/vendor/symfony/console/Application.php(117): Composer\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
0.372 #11 phar:///usr/bin/composer/src/Composer/Console/Application.php(131): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
0.372 #12 phar:///usr/bin/composer/bin/composer(73): Composer\Console\Application->run()
0.372 #13 /usr/bin/composer(29): require('phar:///usr/bin...')
0.372 #14 {main}
0.372   thrown in phar:///usr/bin/composer/src/Composer/Config.php on line 191
------
Dockerfile:89
--------------------
  88 |     # install all PHP dependencies
  89 | >>> RUN if [ "$BUILD_ARGUMENT_ENV" = "dev" ] || [ "$BUILD_ARGUMENT_ENV" = "test" ]; then COMPOSER_MEMORY_LIMIT=-1 composer install --optimize-autoloader --no-interaction --no-progress; \
  90 | >>>     else COMPOSER_MEMORY_LIMIT=-1 composer install --optimize-autoloader --no-interaction --no-progress --no-dev; \
  91 | >>>     fi
  92 |     

However, if a specific version of Composer is specified, everything works as expected:
COPY --from=composer:2.6 /usr/bin/composer /usr/bin/composer

an unexpected error

I got this error

ERROR: Service 'supervisord' failed to build: COPY failed: stat /var/lib/docker/tmp/docker-builder107125242/docker/dev/www.conf: no such file or directory

domain and subdomain in nginx

How I can have domain and subdomain for examle my blog in a WordPress website and I wanna have blog.site.com
where I should config it?

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.