All Projects → osteel → docker-tutorial

osteel / docker-tutorial

Licence: MIT license
Companion repository for a tutorial series about using Docker locally for web development

Programming Languages

PHP
23972 projects - #3 most used programming language
Dockerfile
14818 projects
shell
77523 projects

Projects that are alternatives of or similar to docker-tutorial

todo
An example todo application with Go!
Stars: ✭ 61 (-57.04%)
Mutual labels:  webdevelopment
Awesome-Projects-Collection
This is a beginner-friendly repo to make a collection of some unique and awesome projects. Everyone in the community can benefit & get inspired by the amazing projects present over here.
Stars: ✭ 175 (+23.24%)
Mutual labels:  webdevelopment
h5
🚀 The next generation C# to JavaScript compiler
Stars: ✭ 97 (-31.69%)
Mutual labels:  webdevelopment
Technocrats-HacktoberFest
This Repository invites freelancer friendly neighbourhood developers to contribute to open source .
Stars: ✭ 12 (-91.55%)
Mutual labels:  webdevelopment
hacktoberfest-2021
This repository is made for people who wanted to learn about open-source and paricipate in Hactoberfest 2021.
Stars: ✭ 19 (-86.62%)
Mutual labels:  webdevelopment
programming-notes
Programming notes. About anything really.
Stars: ✭ 34 (-76.06%)
Mutual labels:  webdevelopment
live-reload-vanilla-website-template
Template to build a website without a front-end framework, including transpilation of ES6+ JavaScript and Sass support
Stars: ✭ 47 (-66.9%)
Mutual labels:  webdevelopment
FIFA-18-Management-System
This repository contains the whole project. This project was intended to exhibit as a DBMS project but it can also act as a web development project as it includes complete front end and back end.
Stars: ✭ 42 (-70.42%)
Mutual labels:  webdevelopment
intro-web-dev-2017aut
Site for course "Introduction to Web Design and Development."
Stars: ✭ 13 (-90.85%)
Mutual labels:  webdevelopment
template portfolio
A template for your own Portfolio.
Stars: ✭ 15 (-89.44%)
Mutual labels:  webdevelopment
web-development-resources
Awesome Web Development Resources.
Stars: ✭ 5,359 (+3673.94%)
Mutual labels:  webdevelopment
web-development-learning-resources
💪 Resources to become a senior web developer
Stars: ✭ 21 (-85.21%)
Mutual labels:  webdevelopment
Portfolio-Saurav-Mukherjee
Portfolio website build using HTML5, CSS3, JavaScript and jQuery.
Stars: ✭ 48 (-66.2%)
Mutual labels:  webdevelopment
accessible-name-automation-proof-of-concept
This is an experiment based on Accessibility Object Model (AOM). It tries to demonstrate that it is theoretically possible (in a certain way) to predict what the screen reader will say by focusing on semantic and non semantic elements with a bit of automated testing, thus reducing the need for manual testing.
Stars: ✭ 15 (-89.44%)
Mutual labels:  webdevelopment
ColorPicker
Powerful screen ColorPicker/Chooser application for Linux Desktop
Stars: ✭ 55 (-61.27%)
Mutual labels:  webdevelopment
Portfolio-Website
Portfolio Website build using HTML5, CSS3, JavaScript and jQuery
Stars: ✭ 109 (-23.24%)
Mutual labels:  webdevelopment
API-Class
A utility class for calling apis CRUD methods
Stars: ✭ 89 (-37.32%)
Mutual labels:  webdevelopment
angular
Repository for my tutorial course: Learning AngularJS on LinkedIn Learning and Lynda.com. http://raybo.org/angular
Stars: ✭ 79 (-44.37%)
Mutual labels:  webdevelopment
amazing-react-opensource-2019
Amazing React.js Open Source Tools and Projects for the Past Year (v.2019)
Stars: ✭ 75 (-47.18%)
Mutual labels:  webdevelopment
paper-dashboard-angular
Angular version of the original Paper Dashboard.
Stars: ✭ 142 (+0%)
Mutual labels:  webdevelopment

Docker for local web development, part 1: a basic LEMP stack

This repository accompanies a tutorial series about leveraging Docker for local web development.

The current branch covers part 1 of the series, which is about setting up a basic LEMP stack with Docker Compose. Please refer to the full article for a detailed explanation.

Content

This branch contains a basic LEMP stack running on Docker and orchestrated by Docker Compose, including:

  • A container for Nginx;
  • A container for PHP-FPM;
  • A container for MySQL;
  • A container for phpMyAdmin;
  • A volume to persist MySQL data.

Prerequisites

Make sure Docker Desktop for Mac or PC is installed and running, or head over here if you are a Linux user. You will also need a terminal running Git.

This setup also uses localhost's port 80, so make sure it is available.

Directions of use

Add the following domain to your machine's hosts file:

127.0.0.1 php.test

Clone the repository and change the current directory for the project's root:

$ git clone [email protected]:osteel/docker-tutorial.git
$ cd docker-tutorial

Copy .env.example to .env:

$ cp .env.example .env

Run the following command:

$ docker compose up -d

This may take a little bit of time, as some Docker images might need downloading.

Once the script is done, visit php.test.

Explanation

The images used by the setup are listed and configured in docker-compose.yml.

When building and starting the containers based on the images for the first time, a MySQL database named demo is automatically created (you can pick a different name in the MySQL service's description in docker-compose.yml).

A minimalist Nginx configuration for the PHP application is also copied over to Nginx's container, making it available at php.test.

The src/ directory containing the application is mounted onto both Nginx's and the application's containers, meaning any update to the code is immediately available upon refreshing the page, without having to rebuild any container.

The database data is persisted in its own local directory through the volume mysqldata, which is mounted onto MySQL's container. A phpMyAdmin interface is available at localhost:8080 (the database credentials are root / root).

Please refer to the full article for a detailed explanation.

Cleaning up

To stop the containers:

$ docker compose stop

To destroy the containers:

$ docker compose down

To destroy the containers and the associated volumes:

$ docker compose down -v

To remove everything, including images and orphan containers:

$ docker compose down -v --rmi all --remove-orphans
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].