diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..e879b88 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,22 @@ +# Blockshell in a docker +FROM python:2.7-wheezy +MAINTAINER agentcobra +LABEL maintainer="agentcobra@free.fr" + +RUN apt-get update +RUN apt-get install -y git screen vim + +WORKDIR /opt/ + +RUN git clone https://github.com/agentcobra/blockshell.git +WORKDIR /opt/blockshell +RUN virtualenv venv +CMD source venv/bin/activate +RUN pip install --editable . + +RUN blockshell --help + +EXPOSE 5000 + +RUN python web.py +#CMD script /dev/null diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..c245098 --- /dev/null +++ b/Makefile @@ -0,0 +1,10 @@ +help: ## Écran d'aide + @grep -E '(^[a-zA-Z_-]+:.*?##.*$$)|(^##)' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[32m%-10s\033[0m %s\n", $$1, $$2}' | sed -e 's/\[32m##/[33m/' +build: ## Construction de l'image + docker build -t agentcobra/blockshell . +run: build ## Lance la compilation et l'image docker (garde le conteneur à l'arret) + docker run -d --name blockshell -p 5000:5000 -v app:/var/www/html/app agentcobra/blockshell +shell: ## Lance bash dans le conteneur + docker exec -it blockshell bash +test: build ## Lance la compilation et l'image docker (supprime le conteneur à l'arret) + docker run --rm --name blockshell -p 5000:5000 agentcobra/blockshell