Photo by Brian Jones on Unsplash
Click to expand
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
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
),
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
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.
to turn autoindex off bash ~/autoindex_off.sh
to turn autoindex on bash ~/autoindex_on.sh
๐๐ป Start here
Or start Docker Curriculum by Prakhar Srivastav
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.
- Default workdir
- More about
WORKDIR
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
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 |
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.
www-data:www-data
the first one is user, the second is group. That is what debian
server uses by default.
The y
flag is for auto "Yes"
Difference between apt
and apt-get
:
FLUSH PRIVILEGES
reloads grant tables.
- Demystifying Containers - Part I: Kernel Space by Sascha Grunert
- Demystifying Containers - Part II: Container Runtimes
- Demystifying Containers - Part III: Container Images
- Docker docs
Author Roman Kukin