juanlamarao / 42_ft_server

A automated docker container with LEMP +wordpress +ssl autosigned

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ft_server

Codacy Badge License

An automated docker container using debian:buster image with LEMP, wordpress and autosigned SSL.

How it works

This docker project aims to build multiples services, using only one container:

  1. Web server with Nginx
  2. SQL Database with MariaDB
  3. Database web admin with PhpMyAdmin
  4. OpenSource CMS with Wordpress
  5. Self-signed SSL certificate with OpenSSL
  6. Switch to turn ON or OFF the Nginx auto Index with Shell Script

How to test (choose one)

Option 1: Clonning the repository

  1. git clone https://github.com/juanlamarao/42_ft_server/
  2. cd 42_ft_server
  3. docker build . -t ft_server
  4. docker run -it -p80:80 -p443:443 ft_server

Option 2: Using Docker hub

  1. docker run -it -p80:80 -p443:443 juanlamarao/ft_server:latest

It's time to access it

https://localhost
https://localhost/wordpress
https://localhost/phpmyadmin

Switching the NGINX index ON or OFF

docker exec $(docker ps | grep ft_server | cut -d ' ' -f 1) bash /root/switch_autoindex.sh
https://localhost

After testing you can delete containers and images by running

docker rm $(docker ps -a | grep ft_server | cut -d ' ' -f 1)
docker images -a | grep "ft_server" | awk '{print $3}' | xargs docker rmi

If you used the repository method, remove the debian image as well

docker images -a | grep "buster" | awk '{print $3}' | xargs docker rmi

PT-BR Translation

Um Container Docker automatizado utilizando uma imagem Debian:buster com LEMP, wordpress e SSL autoassinado.

Como funciona

Este projeto docker tem como objetivo construir multiplus serviços, utilizando somente um container:

  1. Servidor Web com Nginx
  2. Banco de dados SQL com MariaDB
  3. Administração web para banco de dados com PhpMyAdmin
  4. Gerenciados de conteúdo para WEB OpenSource com Wordpress
  5. Certificado SSL autoassinado com OpenSSL
  6. Mecanismo para habilitar e desabilitar o autoindex do Nginx com Shell Script

Como testar (escolha uma)

Opção 1: Clonando o repositório

  1. git clone https://github.com/juanlamarao/42_ft_server/
  2. cd 42_ft_server
  3. docker build . -t ft_server
  4. docker run -it -p80:80 -p443:443 ft_server

Opção 2: Utilizando o Docker hub

  1. docker run -it -p80:80 -p443:443 juanlamarao/ft_server:latest

É hora de acessar

https://localhost
https://localhost/wordpress
https://localhost/phpmyadmin

Alternando entre autoindex do NGINX ON e OFF

docker exec $(docker ps | grep ft_server | cut -d ' ' -f 1) bash /root/switch_autoindex.sh
https://localhost

Após testar, você pode remover as imagens e containers com os seguintes comandos

docker rm $(docker ps -a | grep ft_server | cut -d ' ' -f 1)
docker images -a | grep "ft_server" | awk '{print $3}' | xargs docker rmi

Caso tenha utilizado o primeiro método, remova também a imagem do Debian

docker images -a | grep "buster" | awk '{print $3}' | xargs docker rmi

About

A automated docker container with LEMP +wordpress +ssl autosigned

License:MIT License


Languages

Language:Dockerfile 100.0%