Public Repository

Last pushed: 2 years ago
Short Description
This docker image is used as a web server image for PHP projects using a docker-compose.yaml
Full Description

LAMP Project Docker image

This docker image is used as a web server image for PHP projects. The following file is a docker-compose.yaml that should be located in the root of the LAMP project.

NOTE: It is not necessary to pull this image directly. Ensure that docker-compose is installed on your machine and add the docker-compose.yaml file to the root of your project.

# Please note that docker-compose does not prescribe a startup order

# This docker-compose.yaml file is should be placed in the root of a LAMP project
# with the following file structure:
#
# /example.com
# |-- docker-compose.yaml
# |-- public_html
# | `--  [WEBSITE]
# |-- log
# | `--  [EMPTY]
# |-- db_files
# | `--  [DATABASE FILES *.sql]
#
#
# Make sure to change MYSQL environment variables according to your setup.
# This setup creates a virtualhost file for apache so you can reach the site
# with its' specified domain name (SUBDOMAIN.SITENAME)
#
#

version: '2'
services:
  db:
    image: mysql
    ports:
      - "3306:3306"
    volumes:
      - ./db_files:/docker-entrypoint-initdb.d
    environment:
      MYSQL_ROOT_PASSWORD: root
      MYSQL_DATABASE: mysql_db
      MYSQL_USER: mysql_user
      MYSQL_PASSWORD: mysql_pass
  web:
    image: pletron/lamp:latest
    ports:
      - "80:80"
      - "443:443"
    environment:
      - SITENAME=example.com
      - SUBDOMAIN=www
    volumes:
      - .:/var/www/example.com
    depends_on:
      - db
    working_dir: "/var/www/"
    command: "apache2ctl -X -k start"

Enjoy!

Docker Pull Command
Owner
pletron