Code Monkey home page Code Monkey logo

docker-amazonlinux-lamp's Introduction

Docker Amazon Linux LAMP

Creates a LAMP stack image using the official Amazon Linux image for Docker

  • Apache 2.4
  • PHP 7.0
  • MySQL 5.7
  • MongoDB 3.4
  • http and https (unsigned)
  • remote access for MySQL, MongoDB and Memcached

Getting Started

This container is recommended for development use, to mirror or mimic development of an AWS EC2 instance running Amazon Linux.

Build Image

Navigate to directory containing docker file. If downloading from Docker Hub, move on to "Create Container" section.

docker build -t imageName .

Create Container

You will most likely want to develop on your local machine. Create your directory structure on your local machine and figure out where you want your web root to reside. Update the -v ~/www:/var/www/html with the path to your working directory. You can obviously change this to include multiple filepath mappings, where needed.

# Custom Image Build
docker run -ti --name lamp -p 80:80 -p 443:443 -p 3306:3306 -p 11211:11211 -p 27017:27017 -v ~/www:/var/www/html -d imagesName

# Download and Build from Docker Hub
docker run -ti --name lamp -p 80:80 -p 443:443 -p 3306:3306 -p 11211:11211 -p 27017:27017 -v ~/www:/var/www/html -d cjonesdev/amazonlinux-lamp

Working with MySQL

By default, the root user doesn't have a password. Run the following to set the root user password.

docker exec -ti --privileged lamp mysql_secure_installation

Login as ec2-user

docker exec -ti -u ec2-user lamp bash

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.