Skip to content

romanwrites/ft_server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

8 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

ft_server

Photo by Brian Jones on Unsplash

Table of contents:

Click to expand
  1. Description
  2. Instructions
    1. Contents
    2. Download and build
    3. Run a conteiner
    4. Autoindex
  3. Research
    1. Docker
      1. Start here
      2. Virtual Machines vs Containers
    2. Web-server
      1. Server
      2. Linux
      3. Nginx
      4. Mysql
      5. Makefile
      6. Wordpress
      7. SSL
      8. Phpmyadmin
    3. Useful links to understand containers deeper

πŸ‘¨πŸ»β€πŸ« Description

ft_server is a school 21(42) project.

Project could be used to build a LEMP-stack web-server docker image.

Stack of technologies: debian, nginx, mariadb, phpmyadmin, php, wordpress

πŸ‘‰πŸ» Instructions

πŸ“¦ Contents

Dockerfile with all instructions to build a server image.

srcs/ contains configs and some bash scripts.

Makefile to simplify running commands and save or logs while building to the file build_logs (will be created by running make build),

πŸ”¨ Download and build

git clone https://github.com/kukinpower/ft_server.git
cd ft_server
make build

Or you can simply pull the image:

docker pull docker.pkg.github.com/kukinpower/ft_server/ft_server:1.0

πŸƒπŸΌβ€β™€οΈ Run a container

make run to run a container

or docker run -it -p 80:80 -p 443:443 ft_server:latest if you pulled an image from github.

πŸ—‚ Autoindex

to turn autoindex off bash ~/autoindex_off.sh

to turn autoindex on bash ~/autoindex_on.sh

πŸ•΅πŸ½β€β™€οΈ Research

🐳 Docker

πŸ‘‰πŸ» Start here

Or start Docker Curriculum by Prakhar Srivastav

The Docker handbook

If your internet is slow or you are using mobile internet, use this platform to play with docker.

After every instruction a new layer is created.

RUN instruction to execute commands. In shell form it commits a new layer with execution result. The result will be used for a next step. I use \ to split command to several lines.

If WORKDIR isn't specified, the / root directory will be used as work directory.

COPY . .

The first dot . is current folder in host ilesystem, where the Dockerfile is. The second dot . is the folder in docker container filesystem which defined by WORKDIR command in dockerfile

πŸ“¦ Virtual Machines vs Containers

VM Container
Heavyweight Lightweight
Full isolated from the host OS and other VM's Lightweight isolated from host and other containers
Runs it's own OS Shares OS with the host
VM can use different OS from the host Can use OS with the same kernel as host
Startup in minutes Much faster startup

Web-server

🎩 Server

server is a role, that computer takes. Every computer could be a server.

Types of servers are types of services that servers provide.

LEMP stack means: Linux, Nginx, MySQL, PHP.

var/www or var/www/html?

www-data:www-data the first one is user, the second is group. That is what debian server uses by default.

Linux

What is apt-get

The y flag is for auto "Yes"

Difference between apt and apt-get:

Nginx

Mysql

FLUSH PRIVILEGES reloads grant tables.

Wordpress:

πŸ”SSL:

Phpbyadmin

Makefile:

πŸ”— Useful links to understand containers deeper

Author Roman Kukin