Skip to content

Latest commit

 

History

History
130 lines (113 loc) · 2.37 KB

File metadata and controls

130 lines (113 loc) · 2.37 KB

Developer Documentation - Inception

This document provides guidance for developers to set up, build, and manage the Inception project.

Environment Setup

Prerequisites

  1. Operating System: Linux or macOS.
  2. Docker Installed:
    docker --version
    docker compose version
  3. Additional Tools:
    sudo apt-get install make git curl  # Linux
    brew install make git curl         # macOS

Clone the Repository

git clone <repository-url> inception
cd inception

Configure the .env File

  1. Create the .env file in srcs/:
    touch srcs/.env
  2. Add the required variables:
    MYSQL_ROOT_PASSWORD=your_root_password
    MYSQL_DATABASE=wordpress
    MYSQL_USER=your_user
    MYSQL_PASSWORD=your_password
    DOMAIN_NAME=fmorenil.42.fr

Set Up the Local Domain

Add the following line to /etc/hosts:

127.0.0.1    fmorenil.42.fr

Building and Running the Project

Using the Makefile

  • Build and Start:
    make
  • Stop Containers:
    make stop
  • Remove Containers:
    make down
  • Full Cleanup:
    make fclean
  • Rebuild Everything:
    make re

Using Docker Compose Directly

  • Build Images:
    docker compose -f srcs/docker-compose.yml build
  • Start Services:
    docker compose -f srcs/docker-compose.yml up -d
  • Stop Services:
    docker compose -f srcs/docker-compose.yml down

Managing Containers and Volumes

Useful Commands

  • List Running Containers:
    docker ps
  • View Logs:
    docker logs srcs-mariadb-1
  • Access a Container:
    docker exec -it srcs-wordpress-1 bash
  • Inspect Volumes:
    docker volume ls
  • Backup a Volume:
    tar -czf wordpress-backup.tar.gz ~/data/wordpress

Data Persistence

MariaDB Volume

  • Host Path: ~/data/mariadb
  • Contents: Database files and logs.
  • Backup:
    docker exec srcs-mariadb-1 mysqldump -u root -p${MYSQL_ROOT_PASSWORD} wordpress > backup.sql

WordPress Volume

  • Host Path: ~/data/wordpress
  • Contents: WordPress files, themes, plugins, and uploads.
  • Backup:
    tar -czf wordpress-backup.tar.gz ~/data/wordpress