Skip to content

About

My personal Inception for Milestone 5. Let's learn Docker!

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

51 Commits

Folders and files

Repository files navigation

42-Inception

Let's learn Docker!

Project Inception
Locked 2025-07-24 15:34 CET:+0100
Closed 2026-03-02 09:05 CET:+0100
Grade 125% (3⭐ outstanding)
Retries 0

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

Description

Inception is a System Administration related exercise. It aims to broaden knowledge of SysAdmin by using Docker by virtualizing several Docker images, creating them in a new virtual machine.

Instructions

Installation

  1. First, git clone the project:
git clone https://github.com/panda2742/42-Inception
cd 42-Inception
  1. Then, generate secrets/env:
make secrets

It will generate automatically and securely required secrets and environment variables.

Execution

  1. Once the Installation steps are done, build and wait for the whole project to be built:
make all

Resources

Useful Documentation

AI Usage

AI have been carefully used for some topics about this project:

  • Review code and help resolving errors
  • Generating some tests to check if everything is okay
  • Explaining some related topics such as FTP protocol, health checks

Project

Project architecture

.
├── DEV_DOC.md
├── doc
│   └── BONUS.md
├── guardian
│   ├── cmd
│   │   └── guardian
│   │       └── main.go
│   ├── go.mod
│   ├── go.sum
│   ├── guardian
│   ├── internal
│   │   ├── config
│   │   │   ├── config_parser.go
│   │   │   └── constants.go
│   │   ├── envvar
│   │   │   ├── envvar.go
│   │   │   ├── generate.go
│   │   │   ├── prepare.go
│   │   │   └── restrict.go
│   │   └── secrets
│   │       ├── generate.go
│   │       ├── prepare.go
│   │       ├── restrict.go
│   │       └── secrets.go
│   └── pkg
│       ├── output
│       │   ├── output.go
│       │   └── output_utils.go
│       └── utils
│           ├── pair.go
│           └── random.go
├── guardian_conf.toml
├── Makefile
├── README.md
├── scripts
│   ├── hospital.sh
│   └── reset-git.sh
├── srcs
│   ├── docker-compose.yaml
│   └── requirements
│       ├── bonus
│       │   ├── adminer
│       │   │   ├── Dockerfile
│       │   │   └── tools
│       │   │       └── init.sh
│       │   ├── ftp-server
│       │   │   ├── conf
│       │   │   │   └── vsftpd.conf
│       │   │   ├── Dockerfile
│       │   │   └── tools
│       │   │       └── init.sh
│       │   ├── gombling
│       │   │   ├── Dockerfile
│       │   │   ├── go.mod
│       │   │   ├── internal
│       │   │   │   ├── handler
│       │   │   │   │   └── game_handler.go
│       │   │   │   ├── model
│       │   │   │   │   └── game.go
│       │   │   │   └── service
│       │   │   │       └── game_service.go
│       │   │   ├── main.go
│       │   │   ├── static
│       │   │   │   └── css
│       │   │   │       └── style.css
│       │   │   ├── templates
│       │   │   │   └── index.html
│       │   │   └── tools
│       │   │       └── init.sh
│       │   ├── grafana
│       │   │   ├── conf
│       │   │   │   └── grafana.ini
│       │   │   ├── Dockerfile
│       │   │   ├── provisioning
│       │   │   │   ├── dashboards
│       │   │   │   │   ├── dashboards
│       │   │   │   │   │   └── overview.json
│       │   │   │   │   └── dashboards.yml
│       │   │   │   ├── datasources
│       │   │   │   │   └── prometheus.yml
│       │   │   │   └── orgs
│       │   │   │       └── org.yaml
│       │   │   └── tools
│       │   │       └── init.sh
│       │   ├── prometheus
│       │   │   ├── conf
│       │   │   │   └── prometheus.yml
│       │   │   ├── Dockerfile
│       │   │   └── Dockerfile.old
│       │   ├── redis
│       │   │   ├── conf
│       │   │   │   └── redis.conf
│       │   │   ├── Dockerfile
│       │   │   └── tools
│       │   │       └── init.sh
│       │   └── wondercat
│       │       ├── app
│       │       │   ├── app.vue
│       │       │   └── pages
│       │       │       └── index.vue
│       │       ├── Dockerfile
│       │       ├── nuxt.config.ts
│       │       ├── package.json
│       │       ├── package-lock.json
│       │       ├── public
│       │       │   ├── favicon.ico
│       │       │   ├── favicon.png
│       │       │   ├── favicon.svg
│       │       │   └── robots.txt
│       │       ├── README.md
│       │       ├── tools
│       │       │   └── init.sh
│       │       └── tsconfig.json
│       ├── exporters
│       │   ├── mariadb-exporter
│       │   │   ├── Dockerfile
│       │   │   ├── src
│       │   │   │   ├── go.mod
│       │   │   │   ├── go.sum
│       │   │   │   └── mariadb_exporter.go
│       │   │   └── tools
│       │   │       └── init.sh
│       │   ├── nginx-exporter
│       │   │   ├── Dockerfile
│       │   │   └── src
│       │   │       ├── go.mod
│       │   │       ├── go.sum
│       │   │       └── nginx_exporter.go
│       │   ├── phpfpm-exporter
│       │   │   ├── Dockerfile
│       │   │   └── src
│       │   │       ├── go.mod
│       │   │       ├── go.sum
│       │   │       └── phpfpm_exporter.go
│       │   └── redis-exporter
│       │       ├── Dockerfile
│       │       └── src
│       │           ├── go.mod
│       │           ├── go.sum
│       │           └── redis_exporter.go
│       ├── mariadb
│       │   ├── Dockerfile
│       │   └── tools
│       │       ├── healthcheck.sh
│       │       └── init.sh
│       ├── nginx
│       │   ├── conf
│       │   │   └── inception.conf
│       │   ├── Dockerfile
│       │   └── tools
│       │       └── init.sh
│       └── wordpress
│           ├── conf
│           │   └── wp-config.php
│           ├── Dockerfile
│           └── tools
│               └── init.sh
└── USER_DOC.md

Every sources for the project is in the srcs/ directory. Guardian is a secret related project, explained in evaluation.

Services

  • WordPress : a simple CMS.

  • MariaDB : the database associated with WordPress.

  • Nginx : the webserver that serves pages of the project, such as WordPress.

  • [Bonus] Adminer: an equivalent to PhpMyAdmin but uglier.

  • [Bonus] Vsftpd: a simple FTP server.

  • [Bonus] Gombling: you wouldn't know, but you would surely try.

  • [Bonus] Grafana: an advanced monitoring service to inspect exporters data.

  • [Bonus] Prometheus: a datasource from exporters to Grafana. Exports metrics.

  • [Bonus] Redis: a caching system for WordPress.

  • [Bonus] Wondercat: an amazing cat images generator.

Why Docker?

Docker packages applications with their dependencies into portable containers, ensuring consistent behavior across different environments and simplifying deployment.

Why Go?

Go offers fast compilation, built-in concurrency, a single binary deployment, and excellent performance for building scalable services and cloud-native applications.

Virtual Machine vs Docker

VMs virtualize entire operating systems (heavy, slow startup), while Docker containers share the host OS kernel (lightweight, fast startup, more efficient).

Secrets vs Environment Variables

Secrets are encrypted, access-controlled, and designed for sensitive data like passwords, while environment variables are plaintext and better suited for non-sensitive configuration.

Docker Network vs Host Network

Docker networks provide container isolation and custom networking, while host network mode gives containers direct access to the host's network stack (faster but less isolated).

Docker Volumes vs Bind Mounts

Volumes are managed by Docker, persist independently, and work across platforms, while bind mounts directly link host directories (simpler but less portable).

About

My personal Inception for Milestone 5. Let's learn Docker!

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Contributors

Languages