Docker with Apache, MySql, PhpMyAdmin and Php

Overview

docker-lamp

Docker example with Apache, MySql 8.0, PhpMyAdmin and Php

  • You can use MariaDB 10.1 if you checkout to the tag mariadb-10.1 - contribution made by luca-vercelli
  • You can use MySql 5.7 if you checkout to the tag mysql5.7

I use docker-compose as an orchestrator. To run these containers:

docker-compose up -d

Open phpmyadmin at http://localhost:8000 Open web browser to look at a simple php example at http://localhost:8001

Run mysql client:

  • docker-compose exec db mysql -u root -p

Enjoy !

Comments
  • No root access to DB :(

    No root access to DB :(

    Following is mysql part of docker-compose.yml file :

    db:
    
        image: mysql:8.0
        ports: 
            - "3306:3306"
        command: --default-authentication-plugin=mysql_native_password
        environment:
            MYSQL_DATABASE: myDb
            MYSQL_USER: root
            MYSQL_PASSWORD: ''
            MYSQL_ROOT_PASSWORD: ''
            MYSQL_ALLOW_EMPTY_PASSWORD : 'yes'
        restart: always
        volumes:
            - ./dump:/docker-entrypoint-initdb.d
            - ./conf:/etc/mysql/conf.d
            - persistent:/var/lib/mysql
        networks:
            - default
    

    Now, I don't know for what weird reason, but the mysql has added "docker" as user which doesn't have access to create / drop databases. I suspect, this is because of my earlier trial setup which had user named 'docker' in it and the same is getting carried forwarded for mysql. The command 'docker-compose up -d' seems not resetting the mysql image and user "root" is not getting created.

    Is there any ways I could add this user "root" ? Since don't have root access so can't even know if there is any root user added already. I tried "docker-compose exec db mysql -u root -p" with "root" as password, says access denied... with blank password, says access denied...

    Any help please ?

    Thanks

    opened by sandipt27 4
  • Error While connecting to Database

    Error While connecting to Database

    Hi, I am getting an error:

    Warning: mysqli_connect(): (HY000/1130): Host 'dockerapp_www_1.dockerapp_default' is not allowed to connect to this MySQL server in /var/www/html/index.php on line 19

    Warning: mysqli_query() expects parameter 1 to be mysqli, bool given in /var/www/html/index.php on line 23

    Fatal error: Uncaught Error: Call to a member function fetch_array() on null in /var/www/html/index.php:27 Stack trace: #0 {main} thrown in /var/www/html/index.php on line 27

    opened by muhammadnaveel 4
  • Cannot find DB error

    Cannot find DB error

    Travelling to localhost:8001 shows this:

    Hi! I'm happy

    Warning: mysqli_connect(): (HY000/1049): Unknown database 'myDb' in /var/www/html/index.php on line 19

    Warning: mysqli_query() expects parameter 1 to be mysqli, boolean given in /var/www/html/index.php on line 23

    Fatal error: Uncaught Error: Call to a member function fetch_array() on null in /var/www/html/index.php:27 Stack trace: #0 {main} thrown in /var/www/html/index.php on line 27

    opened by jayshrivastava 4
  • Unable to insert into database

    Unable to insert into database

    Hi, First of all, wanna say, this docker system is great! Running into a bit of an issue though. Whenever I try to insert data into a database, it just doesn't work... I've got a completely fresh download from the repo, but it won't insert that data. Do you have any idea on what I could do?

    opened by NetSpud 1
  • Hi

    Hi

    Hi, I am trying to have a ready docker for LAMP. This is so far a gaziliion try but looks much more close to a functional one. Still I am getting this:

    ERROR: for db Cannot start service db: driver failed programming external connectivity on endpoint dockerlamp_db_1 (ab07b9901a6273dd0ab46f68f17f1ad6643443ef9a35e7699c1c6d18cbf21235): Error starting userland proxy: listen tcp 0.0.0.0:3306: bind: address already in use ERROR: Encountered errors while bringing up the project.

    opened by ghost 1
  • Internal Server Error

    Internal Server Error

    I'm try to deploy a web app to docker and i write an .htaccess like the code below :

    **RewriteEngine On

    RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-l

    RewriteRule ^(.+)$ index.php?url=$1 [QSA,L]**

    And it cause an internal server error , but when i remove the code it works normally. Can you explain where it is wrong , because i have not experince in writing htaccess file .

    opened by batisuoc 1
  • LEMP

    LEMP

    Hello sir, could you please make the same lightweight dockerfile and .yml with all the same component, with only change that nginx be included against httpd? Thanks.

    opened by Oddisey000 1
  • Fails to Install Security Certificate

    Fails to Install Security Certificate

    My org needs Security Certificate to be installed. So placed commands to copy the certificate file in Dockerfile which works great !

    However, for installing the same, In Dockerfile I added the line

    RUN dpkg-reconfigure ca-certificates

    But it doesn't add the Certificate. I even tried with

    RUN update-ca-certificates

    but it still doesn't add the Certificate.

    I confirmed this by going into the docker shell and trying and executing

    curl -v https://www.google.com

    which failed miserably.

    Any specific changes I need to do in my Dockerfile to install the Certificate please ?

    opened by sandipt27 1
  • Question. How is suppose to be use?

    Question. How is suppose to be use?

    I Know that with docker-compose up... I spin up Everything.

    But what About the DB? I Know I Can't manually import it... But is there any automatic mechanism that will import the dump?

    opened by juan-morales 3
Owner
Joel Cavat
Joel Cavat
PHP implementation for reading and writing Apache Parquet files/streams

php-parquet This is the first parquet file format reader/writer implementation in PHP, based on the Thrift sources provided by the Apache Foundation.

null 17 Oct 25, 2022
A complete stack for running Symfony 5 into Docker containers using docker-compose tool and with Certbot for the HTTPS certificate.

?? Docker + PHP 7.4 + MySQL8.0 + Nginx + Certbot(HTTPS) + Symfony 5 Boilerplate ?? Edited from https://github.com/ger86/symfony-docker version -> http

null 6 Nov 9, 2022
Docker-magento2 - 🐳 Docker containers with all required Magento 2 dependencies installed available as FPM through Nginx and CLI

Magento 2 Docker A collection of Docker images for running Magento 2 through nginx and on the command line. Quick Start cp composer.env.sample compose

Meanbee 454 Dec 27, 2022
Apache OpenWhisk is an open source serverless cloud platform

OpenWhisk OpenWhisk is a serverless functions platform for building cloud applications. OpenWhisk offers a rich programming model for creating serverl

The Apache Software Foundation 5.9k Jan 8, 2023
Docker-magento - Docker image for Magento 1.6 to 1.9

Docker image for Magento 1.x This repo creates a Docker image for Magento 1.x. Please note The primary goal of this repo is to create Docker images fo

Fu Cheng 144 Nov 18, 2022
🐋 This project aims to broaden knowledge of system administration by using Docker: virtualizing several Docker images, creating them in a new personal virtual machine.

?? This project aims to broaden knowledge of system administration by using Docker: virtualizing several Docker images, creating them in a new personal virtual machine.

Anton Kliek 1 Jan 26, 2022
Lumen on Docker - Skeleton project with Nginx, MySQL & PHP 8 | Aws ECS, Google Kubernates, Azure Container Engine

Docker infrastructure for Lumen Description Microservice Lumen is a starting skeleton based on Docker and Lumen Framework. This project helps to devel

Fabrizio Cafolla 218 Sep 25, 2022
Php-gamer - A repo with PHP 8.1, Swoole and Laminas. And of course, Docker in the front.

PHP-Gamer Instructions for run this app: First time $ git clone [email protected]:fatorx/php-gamer.git $ cd php-gamer $ chmod +x docker-build.sh $ chmod

Fabio de Souza 6 Oct 6, 2022
Mage2click toolset to create and manage the Magento Docker development environment with mutagen.io file-sync for macOS and native filesystem mounts on Linux.

Mage2click - Magento Docker Toolset Mage2click toolset is a system-wide command-line tool for creating and managing simultaneously running Magento Doc

Mage2click 69 Nov 28, 2022
Running Laravel and React stacks together using Vite and InertiaJS on Docker.

Laravel-Vite-Docker Running Laravel and React stacks together using Vite and InertiaJS on Docker. Explore project's blog » Report Bug · Request Featur

Elvin Lari 6 Dec 22, 2022
Learn how to run WordPress with Docker. Read about our experiences and start off with an easy boilerplate.

Hi! We're Dan and Jay. We're a two person team with a passion for open source products. We created Server Side Up to help share what we learn. Find us

Server Side Up 7 Sep 17, 2022
Main ABRouter product repository that contains docker-compose file and orchestrates the project containers.

ABRouter-Compose ?? ABRouter is the open-source tool to perform and track A/B tests which is also known as the experiments. Additionally, feature flag

ABRouter 29 Dec 22, 2022
Full PHP development environment for Docker.

Full PHP development environment based on Docker. Use Docker First - Learn About It Later! Join Us Awesome People Laradock is an MIT-licensed open sou

laradock 11.7k Jan 7, 2023
Easily install PHP extension in Docker containers

Easy installation of PHP extensions in official PHP Docker images This repository contains a script that can be used to easily install a PHP extension

Michele Locati 2.8k Jan 4, 2023
Docker image that provides static analysis tools for PHP

Static Analysis Tools for PHP Docker image providing static analysis tools for PHP. The list of available tools and the installer are actually managed

Jakub Zalas 1.1k Jan 1, 2023
Setup Docker Para Projetos Laravel 9 com PHP 8

Setup Docker Para Projetos Laravel 9 com PHP 8

EspecializaTi 56 Dec 6, 2022
This is a collection of tutorials for learning how to use Docker with various tools. Contributions welcome.

Docker Tutorials and Labs At this time we are not actively adding labs to this repository. Our focus is on training.play-with-docker.com where new lab

Docker 11.1k Jan 2, 2023
Selfoss Webfront Docker

Selfoss-WF on Docker This is a docker compose for Selfoss and my Selfoss-Webfront all packaged together ready to go. Features A robust RSS solution to

null 50 Nov 20, 2022
Imagem de Laravel com Docker para projetos futuros

LaraDocker Este projeto foi criado com a intensão de facilitar o desenvolvimento de novos projetos que podem a ser desenvolvidos por mim, ou por outra

Silas S. da Silva. 1 Nov 6, 2021