I set up this repository for anyone who wants to start web development using the docker environment. There are three container images that I have configured using docker-compose.yml with the addition of a Dockerfile
SPECIFICATION OF CONTAINER :
- Web server : nginx:stable-alpine
- Database driver : mariadb:10.6.4-focal
- PHP version : php:8.1-fpm
- Node version : coming soon I will added the package into Dockerfile
GETTING STARTED (USING MAC / LINUX)
- Make sure your local machine have docker engine and docker-compose latest version. If your local machine doesn't installed, you can install first here !
- Clone this repository
git clone https://github.com/OxiCuza/web-dev-environment.git
- Change working directory
cd web-dev-environment
- Make a folder called mysql to store your persistent data (like create a new db without using phpmyadmin)
mkdir "mysql"
- Make a folder called src to save all project do we have
mkdir "src"
- Change working directory to src folder
cd src
- Make a folder called public for the first project sample folder
mkdir public
- And then create file index.php inside public folder. This is sample of content inside index.php
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Example page using docker</title>
</head>
<body>
<h1>HELLO WORLD !</h1>
</body>
</html>
- For this moment we should build our docker container from docker-compose.yml (make sure your working directory inside web-dev-environment)
docker-compose up
OR
docker-compose up -d
- Finally you can open the web browser and type localhost in address bar, and viola ! you have web development environment using docker.
MAKE MULTIPLE PROJECT INSIDE "src" FOLDER
coming soon
CREATE NEW DATABASE INSIDE "mysql" FOLDER WITHOUT USING PHPMYADMIN / ADMINER
coming soon
CONFIGURATION URL FOR MULTIPLE PROJECT DEVELOPMENT
coming soon
NOTE : If you have more question about this repository you can contact me in : oxicusa@gmail.com / oxi@imaginecreative.co.id