Skip to content

42 project - Introduction to sys admin, Docker and web server.

Notifications You must be signed in to change notification settings

mvaldes42/ft_server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FT_SERVER

HOW TO RUN THE PROJECT

Start the container

Check if ports 80 and 443 are already used :
sudo lsof -i -P -n | grep LISTEN
Close those services :
sudo service <nginx> stop

Then make and run container :
sh run.sh

Turn on/off autoindex

docker exec -it server_ctn /bin/bash

$sh usr/srcs/autoindex_switch.sh

Stop, delete and clean all

sh clean.sh

COMMANDS

Utils

docker ps -a list all containers
docker images -a list all images

(alternative) Build an image

docker build -t server_img .

(alternative) Create & start a container

docker create --tty --interactive --name="server_ctn" server_img
docker start server_ctn

(alternative) Stop, delete and clean

docker system prune -f -a to clean unused objects
docker container prune to remove all stopped containers
docker container stop $(docker container ls -aq) stop all containers
docker container rm $(docker container ls -aq) remove all containers
docker image prune -aremove all unused images

SOURCES