Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Inception

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

Description

Inception is a 42 school project which is about using Docker. This project aims to broaden your knowledge of system administration by using Docker. You will virtualize several Docker images, creating them in your new personal virtual machine.

Instructions

    #to build or run all containers
    make 
    
    # to stop all containers
    make down

    # to stop and delete all volumes
    make clean
    
    # to remove all containers and volumes
    make fclean
       
    # to remove everything and build right after
    make re
  • When all containers are run you can go to aroualid.42.fr.

  • As an admin user you can go to aroualid.42.fr/wp-admin to connect and do this :
    • Modify the website.
    • Create new posts.
    • Approve or disapprove comments posted by non-admin users.

  • As a non-admin user you can go to aroualid.42.fr/wp-admin and connect to this:
    • Create new posts.
    • Post comments under posts.

  • As a guest user you can go to aroualid.42.fr and :
    • Post comments under posts.

  • To login to the database you can use the comman line sudo docker exec -it srcs-mariadb-1 mysql -u (your mariaDB username) -p and after type you mariaDB password.

  • Useful commands to navigate through the database:
    • USE database_name; — Selects the specific database you want to work with.
    • SHOW TABLES; — Lists the tables, sequences, and views in the current database.
    • SELECT * FROM wp_posts; — Displays a table of all rows and columns from the specified table. Here, we use the * wildcard to select everything from wp_posts.

Resources

wp config set WP_HOME "https://$WP_DOMAIN_NAME" --allow-root
wp config set WP_SITEURL "https://$WP_DOMAIN_NAME" --allow-root
wp search-replace "http://$WP_DOMAIN_NAME" "https://$WP_DOMAIN_NAME" --all-tables --allow-root

because when i was trying to go to my wp-admin page it was http://aroualid.42.fr/wp-admin instead of https://aroualid.42.fr/wp-admin and my mate wnocchi help me because he goes threw the same issues and told me to do this.

  • I use Gemini Ai to debug because sometimes it was just some syntax errors on Dockerfiles or Shell scripts.

Project Description

Here are some comparaisons betwen

Comparaison

point
Virtual

Machine
Docker
Starting time Can take minutes to start Start in seconds
Setup time Can be very long to setup Can be setup very fast
Weight Can weight Go Can weight only somes Mo
Creation Few amount of already existing VM There is a lot of Docker ready to use
Security Protect process at material level Protect process at OS level
Comparaison

point
Secrets Environment Variables
Stockage Encrypt data Data stored in raw format
Visibility in shell Invisible in the shell You can cat the .env file
Asignation One Secrets per service A .env file can be used by multiple services
Transmission Natively transmittable between user Only transmitable by coping the file
Comparaison point Docker Network Host Network
Port Mapping (-p) Required: You must map ports (e.g., 8080:80). Ignored: Port 80 in container is port 80 on host.
Performance Small overhead due to NAT/Docker Proxy. Native: No overhead, maximum network speed.
Security Stronger: Only explicitly mapped ports are open. Lower: All container ports are exposed to the host.
Connectivity Uses Docker DNS (reach services by name). Uses localhost or the host's actual LAN IP.
OS Support Works on Linux, macOS, and Windows. Native Linux (Limited on Docker Desktop).
Docker Volumes Bind Mounts
Docker volume is the recommended method for storing data created and utilized by Docker containers is to use volumes Bind mount has existed from Docker's early versions. Comparatively speaking, bind mounts are less useful than volumes
Docker volumes may be interacted with using CLIs and APIs Bind mounts cannot be accessed by CLI commands. You may still work instantly with them on the host system
All you need is the volume name to mount it When using bind mounts for mounting, a route to the host computer must be supplied
In /var/lib/docker/volumes, the volumes are stored On the host computer, a bind mount can be located anywhere

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages