Public | Automated Build

Last pushed: 2 years ago
Short Description
Lamp with SSL
Full Description

lamp-ssl

Usage

To create the image damienlagae/lamp-ssl, execute the following command on the lamp-ssl folder:

docker build -t damienlagae/lamp-ssl .

Running your LAMP docker image

Start your image binding the external ports 80, 443 and 3306 in all interfaces to your container:

docker run -d -p 80:80 -p 443:443 -p 3306:3306 damienlagae/lamp-ssl

Test your deployment:

Go to http://localhost/

Loading your custom PHP application

create a new Dockerfile in an empty folder with the following contents:

FROM damienlagae/lamp-ssl:latest
RUN rm -fr /var/www/html && git clone https://github.com/username/customapp.git /var/www/html
EXPOSE 80 443 3306
CMD ["/run.sh"]

replacing https://github.com/username/customapp.git with your application's GIT repository.
After that, build the new Dockerfile:

docker build -t username/my-lamp-app .

And test it:

docker run -d -p 80:80 -p 443:443 -p 3306:3306 username/my-lamp-app

Test your deployment:

Go to http://localhost/

That's it!

Connecting to the bundled MySQL server from within the container

The bundled MySQL server has a root user with password toor for local connections.
Simply connect from your PHP code with this user:

<?php
$mysql = new mysqli("localhost", "root", "toor");
echo "MySQL Server info: ".$mysql->host_info;
?>
Docker Pull Command
Owner
damienlagae
Source Repository

Comments (0)