Skip to content
brturcioPublic

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This project has been created as part of the 42 curriculum by brturcio.

Inception

Description

Inception is a system administration project based on Docker.
Its goal is to build a small web infrastructure using Docker Compose, with separate containers for:

  • NGINX with TLS
  • WordPress with PHP-FPM
  • MariaDB

The project also uses environment variables, Docker secrets, named volumes, and a dedicated Docker network.

Project Description

This project uses Docker to isolate each service in its own container and manage the full stack with docker-compose.yml.

Main design choices

  • One container per service
  • One Dockerfile per service
  • NGINX as the only public entry point on port 443
  • WordPress and MariaDB connected through a Docker network
  • Persistent data stored in named volumes under /home/brturcio/data

Comparisons

Virtual Machines vs Docker

Virtual machines emulate a full operating system, while Docker containers share the host kernel and are lighter and faster.

Secrets vs Environment Variables

Environment variables are used for general configuration. Secrets are used for sensitive data such as passwords.

Docker Network vs Host Network

A Docker bridge network allows containers to communicate safely by service name. Host networking is not used and is forbidden by the subject.

Docker Volumes vs Bind Mounts

Docker volumes are better suited for persistent service data. In this project, named volumes are used and stored under /home/brturcio/data.

Instructions

Configuration

Edit srcs/.env with your values:

LOGIN=brturcio
DOMAIN_NAME=brturcio.42.fr

DB_NAME=wordpress
DB_USER=brturcio

WP_TITLE=Inception
WP_ADMIN_USER=brturciomain
WP_ADMIN_EMAIL=main@gmail.com

WP_USER=brturciouser1
WP_USER_EMAIL=user1@gmail.com

Create these local secret files:

- secrets/db_password.txt
- secrets/db_root_password.txt
- secrets/credentials.txt

Example for credentials.txt:

WP_ADMIN_PASSWORD=your_admin_password
WP_USER_PASSWORD=your_user_password

Add this line to /etc/hosts:

127.0.0.1 brturcio.42.fr

Run

make build

Useful commands:

make
make ps
make logs
make down
make clean
make fclean
make re

Access

Website

https://brturcio.42.fr

Admin panel

https://brturcio.42.fr/wp-admin

A browser warning may appear because the certificate is self-signed.

Resources

References

  • Docker documentation
  • Docker Compose documentation
  • NGINX documentation
  • MariaDB documentation
  • WordPress documentation
  • PHP-FPM documentation
  • OpenSSL documentation

Use of AI

AI was used to clarify Docker concepts, understand configuration errors, review architecture choices, and improve the structure of the documentation.
All implementation, testing, and validation were reviewed manually.

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages