No description
  • Shell 36.5%
  • Dockerfile 33.5%
  • Makefile 19.8%
  • PHP 10.2%
Find a file
2026-01-13 13:09:26 +01:00
srcs final config 2026-01-08 14:58:59 +01:00
.gitignore add: gitignore 2025-12-16 12:29:26 +01:00
DEV_DOC.md add: Dev documentation 2026-01-13 13:09:26 +01:00
Makefile feat(Makefile): handle secrets creation 2026-01-12 15:33:26 +01:00
README.md fix: readme 2026-01-12 14:33:19 +01:00
USER_DOC.md add: user_doc readme 2026-01-12 15:59:48 +01:00

Inception

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


Description

Overview

This project aim to introduce us to DevOps by learning to use Docker, a well-known tool to create isolated and reproducible environments used for running tools and projects under the same conditions for everyone that may use these.

Docker is different from a virtual machine, a virtual machine simulate a whole computer and all of it's component, but Docker is just and isolated process running an OS but directly using host hardware. It's like if you want to cook an egg you use just a pan and a fire instead of a whole kitchen.

We also learn how to setup a basic web infrastructure using WordPress as the front-end and back-end, MariaDB as the WordPress database and Nginx as the web server.

Details

All Dockers images are built rootless, it means that in the Dockerfiles there is always a user with minimal privileges and minimal accesses in the containers. It add a security layer in case of escalation from the end service.

My images uses Alpine as base image because of the lightweight and the minimal environment, i don't like having things that i don't use in images. Benchmarking Debian vs Alpine as a Base Docker Image — Nick Janetakis

All sensitive information such as admin credentials or database password is stored locally and injected into containers using Docker Secrets alongside non sensitive configuration in environment files. It's better to use Docker Secrets for sensitive informations because it's mounted as a file in the container, env vars are visible to every process started in the containers and in docker inspect.

Docker Volumes are used to manage persistent data. They are complex space managed by docker, so they have utility commands, adapt better to every environments, and are also only accesible by root outside containers. We can use bind mounts, but they are just a link of a folder into a folder inside the container, so it require to be managed by hand and we need to take care of permissions. Usually docker volumes are better, more secure and easier to use.

All containers are connected into the same Docker Network, it's used to created a lan bridged to the host with all containers inter connected and reachable with their container name. It's better to use docker network because it isolate the containers from the host and make using custom ports easie. For example multiple containers can use the port 80 by default, and then mapping each container to a specific port on the host.

Instructions

Building and launching:

make build

Stopping without deleting container:

make stop

Starting containers:

make up

Deleting containers:

make down

Deleting containers and the volumes content:

sudo make fulldown

Resources

AI was not used on this project like any of my other project where no repetitive and predictable task are needed. 42 is a school with peer-to-peer at it's heart and i got all of my anwers by asking and talking with my peers.

APA 7 standard generation: https://www.scribbr.fr/


Srivastav, P. (n.d.). A docker tutorial for beginners. A Docker Tutorial for Beginners. https://docker-curriculum.com/

Faour, M. (2024, 28 mai). Container Lifecycle | Improve it with PID 1 in Docker. Theodo Cloud. https://cloud.theodo.com/en/blog/docker-processes-container

Inc, Docker. (2025, 14 november). Dockerfile reference. Docker Documentation. https://docs.docker.com/reference/dockerfile/

Inc, Docker. (2025, 19 december). Best practices. Docker Documentation. https://docs.docker.com/build/building/best-practices/

Janetakis, N. (2018, July 10). Benchmarking Debian vs Alpine as a Base Docker Image. Nick Janetakis. https://nickjanetakis.com/blog/benchmarking-debian-vs-alpine-as-a-base-docker-image

Inc, Docker. (2026, January 8). Get started. Docker Documentation. https://docs.docker.com/get-started/

Schmidt, J. (2024, November 6). Understanding the docker USER instruction. Docker. https://www.docker.com/blog/understanding-the-docker-user-instruction/

Top 20 Dockerfile best practices | Sysdig. (n.d.). https://www.sysdig.com/learn-cloud-native/dockerfile-best-practices

Inc, Docker. (2026a, January 7). Docker compose. Docker Documentation. https://docs.docker.com/compose/

Inc, Docker. (2025a, August 26). Secrets in Compose. Docker Documentation. https://docs.docker.com/compose/how-tos/use-secrets/

MariaDB. MariaDB Installtion. https://mariadb.com/docs/server/server-management/install-and-upgrade-mariadb/installing-mariadb/binary-packages/installing-mariadb-binary-tarballs

Udasi, A. (2025, July 30). Docker Compose Health Checks: an easy-to-follow guide. Last9. https://last9.io/blog/docker-compose-health-checks/

Nginx. Beginners Guide. https://nginx.org/en/docs/beginners_guide.html

WP-CLI | Wordpress Command Line Utility. https://wp-cli.org/

Touesnard, B. (2025, November 17). Configure Nginx to Serve WordPress Over HTTPS. SpinupWP. https://spinupwp.com/hosting-wordpress-yourself-setting-up-sites/