An open API service indexing awesome lists of open source software.

https://github.com/mlouguid/containerize-app-php

How to dockerize simple project php-nginx-mysql-redis
https://github.com/mlouguid/containerize-app-php

docker docker-compose github-actions k8s mysql nginx php redis

Last synced: about 1 year ago
JSON representation

How to dockerize simple project php-nginx-mysql-redis

Awesome Lists containing this project

README

          

# containerize-php-app

php mysql mysql redis nginx docker k8s

## Project Requirements
β€’ Containerized application using PHP, Nginx, MySQL, and Redis
β€’ Simple PHP application code for demonstration
β€’ CI/CD setup using GitHub Actions
β€’ Deployment to Kubernetes (K8s)

## πŸš€ To get started quickly, just follow these steps:
πŸ’‘ **Note**: Before starting the project locally, make sure you have Docker Desktop and Docker Compose installed on your system.

> - [Install Docker & Docker Compose on macOS](https://docs.docker.com/desktop/install/mac-install/)
> - [Install Docker & Docker Compose on Windows](https://docs.docker.com/desktop/install/windows-install/)

Once installed, you’re ready to spin up the environment locally.

## Infra Project

```sh
β”œβ”€β”€ docker-compose.yaml
β”œβ”€β”€ services/
β”‚ β”œβ”€β”€ database/
β”‚ β”‚ β”œβ”€β”€ mysql/
β”‚ β”‚ β”‚ β”œβ”€β”€ Dockerfile
β”‚ β”‚ β”‚ β”œβ”€β”€ .env
β”‚ β”‚ β”œβ”€β”€ redis/
β”‚ β”‚ β”‚ β”œβ”€β”€ Dockerfile
β”‚ β”‚ β”‚ β”œβ”€β”€ .env
β”‚ └── web/
β”‚ β”œβ”€β”€ nginx/
β”‚ β”‚ β”œβ”€β”€ Dockerfile
β”‚ β”‚ β”œβ”€β”€ app.conf
β”‚ β”‚ β”œβ”€β”€ fastcgi_params
β”‚ β”‚ └── .env
β”‚ └── php/
β”‚ β”œβ”€β”€ public/
β”‚ β”‚ └── index.php
β”‚ β”œβ”€β”€ src/
β”‚ β”œβ”€β”€ composer.json
β”‚ β”œβ”€β”€ Dockerfile
β”‚ β”œβ”€β”€ .env
β”œβ”€β”€ infra/
β”‚ β”œβ”€β”€ k8s/
β”‚ β”œβ”€β”€ deployments/
β”‚ └── services/
```

## Deploy to Docker Compose

```sh
docker-compose up -d
```

## Deploy to k8s
```sh
kubectl apply -f infra/k8s
```