Skip to content

OthelloPlusPlus/Inception

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Inception

The Inception project requires you to setup a functional WordPress website. For the website NGINX shall serve as its webserver and MariaDB shall contain the database for WordPress. All aspects of this project must be run on a seperate Docker container for each service. Thus an infrastructure must be build, allowing these services to communicate over their private network and they must have their own volumes, allowing them to contain their own persistent data.

Table of Contents

Docker

Docker is a platform that enables developers to easily pack, ship, and run applications as lightweight, portable containers. These containers are isolated environments that contain everything needed to run the application, including the code, runtime, system tools, and libraries. Docker simplifies the deployment process by ensuring consistency across different environments, from development to production.

Docker Image

An image in Docker is a lightweight, standalone, and executable software package that contains everything needed to run a piece of software, including the code, runtime, libraries, environment variables, and system tools. It serves as a blueprint for creating containers and can be built using a Dockerfile or pulled from a registry like Docker Hub.

creation:
    docker build            # Build an image from a Dockerfile.

deletion:
    docker rmi              # Remove one or more images.

information:
    docker images           # List images.
    docker inspect          # Display detailed information on one or more images.
    docker history          # Show the history of an image.

registry:
    docker login            # Log in to a Docker registry.
    docker logout           # Log out from a Docker registry.
    docker pull             # Pull an image or a repository from a registry.
    docker push             # Push an image or a repository to a registry.

Docker Container

A container is a runnable instance of an image. It encapsulates the application and its dependencies, running in isolation from other containers and the host system. Containers are lightweight, portable, and can be easily moved or replicated across different environments. They have their own filesystem, network, and process namespace, providing isolation and ensuring that they do not interfere with each other.

creation:
    docker run              # Run a command in a new container.
    docker create           # Create a new container but do not start it.
    docker start            # Start one or more stopped containers.

interaction:
    docker exec             # Run a command in a running container.
    docker attach           # Attach to a running container.
    docker pause            # Pause all processes within one or more containers.
    docker unpause          # Unpause all processes within one or more containers.
    docker cp               # Copy files/folders between a container and the local filesystem.

deletion:
    docker stop             # Stop one or more running containers.
    docker kill             # Kill one or more running containers.
    docker rm               # Remove one or more containers.
    docker prune            # Remove all stopped containers.

information:
    docker ps               # List containers.
    docker inspect          # Display detailed information on one or more containers.
    docker logs             # Fetch the logs of a container.

Docker Volume

A volume in Docker is a persistent data storage mechanism that allows data to be shared between containers or between a container and the host system. Volumes are used to persist data generated by containers, ensuring that data is preserved even if the container is stopped or deleted. They provide a way to manage data separate from container lifecycle, making it easier to manage stateful applications.

creation:
    docker volume create    # Create a new volume.

deletion:
    docker volume rm        # Remove one or more volumes.
    docker volume prune     # Remove all unused volumes.

information:
    docker volume ls        # List volumes.
    docker volume inspect   # Display detailed information on one or more volumes.

Docker Network

A network in Docker is a communication channel that allows containers to communicate with each other and with external networks. Docker networks provide isolation and segmentation, allowing containers to be grouped together based on their communication needs. They enable services running in containers to communicate securely and efficiently, facilitating microservices architecture and distributed application deployment. Docker provides various network drivers to support different network configurations and requirements.

creation:
    docker network create     # Create a new network.

interaction:
    docker network connect    # Connect a container to a network.
    docker network disconnect # Disconnect a container from a network.

deletion:
    docker network rm         # Remove one or more networks.

information:
    docker network ls         # List networks.
    docker network inspect    # Display detailed information on one or more networks.

Dockerfile

A Dockerfile is a text document that contains instructions for building a Docker image. These instructions define the environment inside the container, including the base image, dependencies, environment variables, and commands to run when the container starts. Dockerfiles provide a reproducible and automated way to create consistent Docker images, making it easy to share and deploy applications across different environments.

# Base Image
FROM ubuntu:latest                         # Set the base image for subsequent instructions

# External Configuration
ONBUILD ADD . /app                         # Add a trigger instruction to be executed when the image is used as the base for another build
LABEL author="Othello"                     # Specifies the maintainer of the Dockerfile
USER user:group                            # Set the user or UID for the container
SHELL ["/bin/bash", "-c"]                  # Configure the shell used for executing commands

# File System Operations
VOLUME ["/data"]                           # Creates a mount point and marks it as externally mounted
COPY . /app                                # Copies files or directories from the build context to the image
ADD http://example.com/file.txt /file.txt  # Copies files or directories from the build context to the image and allows URLs and TAR extraction

# Internal Configuration
ENV APP_ENV=production                     # Sets an environment variable in the image
ARG VERSION=latest                         # Defines a build-time variable with an optional default value
RUN apt-get update && \                    # Executes a command in the image
    apt-get install -y curl
WORKDIR /app                               # Sets the working directory for subsequent instructions

# Networking
EXPOSE 8080                                # Exposes a port at runtime for networking

# Health Check
HEALTHCHECK --interval=30s --timeout=3s \  # Defines a health check command
    CMD /path/to/health_check_script.sh

# Execution and Entrypoint
ENTRYPOINT ["node", "app.js"]              # Configures the container to run as an executable
CMD ["--config", "config.json"]            # Specifies the default command to run when the container starts

dockerMonitor.sh

A simple shell script that in real time keeps track of the docker images, containers, volumes and networks. It updates whenever there is a docker event or every 10 seconds.

Sub-README Files

Evaluation

Score: 100%

"Looks good. Evaluatee is enthousiastic in his explanations. Was able to explain everything into great detail and everything works as it should. The monitoring script is handy and works well. Good luck with your next evaluation :)" - Ferry Ras

Score: 100%

"Really nice explanations of the code. The bonus you did yourself were amazing to be able to test this project and understand it. I really gotalot from this eval and I'm pretty sure you will past your last eval. Good luck for Transcendance" - Maximilien Bernede

Score: %

"This was very in(ception)sightful and you could count on me being very re(in)ceptive to you explenations, also, you did a very good job at hiding all of the stuff that should have been hidden. They were very hard to find. Christopher Nolan would have been proud of you.... or Leo... or whoever, just be proud of yourself young man. This was an In(ception)credible project. Also, for everyone reading this on github: all of the above text is factually acurate and verified by multiple lawyers. Some of the facts may have been changed to suit my current mood though. Orlando does not require any serious feedback you silly person. " - Alexander Von Benckendorff

Creator

Othello
LinkedIn LinkedIn

About

Docker containers

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors