diff --git a/.docker/base/Dockerfile b/.docker/base/Dockerfile new file mode 100644 index 0000000..ebc07bc --- /dev/null +++ b/.docker/base/Dockerfile @@ -0,0 +1,6 @@ +FROM alpine:3.10 +WORKDIR /app +RUN set -xe && \ + apk -U add bash git curl wget npm && \ + npm install -g bower && \ + npm install -g gulp diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 4ccff56..0000000 --- a/Dockerfile +++ /dev/null @@ -1,10 +0,0 @@ -FROM alpine:3.10 AS builder -WORKDIR /app -COPY . /app -RUN set -xe && \ - apk -U add git curl wget npm && \ - npm install -g bower && \ - bower install --allow-root - -FROM httpd:2.4 -COPY --from=builder /app /usr/local/apache2/htdocs diff --git a/Makefile b/Makefile new file mode 100755 index 0000000..3ff70aa --- /dev/null +++ b/Makefile @@ -0,0 +1,12 @@ +install: + docker build -t ks-base .docker/base + docker-compose -f docker-compose.builder.yml run --rm install + +start: + docker run -dit --rm --name ks-server -p 8000:80 -v `pwd`:/usr/local/apache2/htdocs/ httpd:2.4 + +stop: + docker stop ks-server + +build: + docker-compose -f docker-compose.builder.yml run --rm build diff --git a/README.md b/README.md index 14bb2d1..b038724 100644 --- a/README.md +++ b/README.md @@ -10,11 +10,10 @@ Alors, c'est classe ou c'est pas classe ? Ou c'est classe ? Pour faire fonctionner le projet sur votre machine, vous devrez tout d'abord, depuis la racine, exécuter la commande `bower install` puis accéder au fichier `index.html` via le serveur Web de votre choix (Apache pour moi, quand je ne suis pas sioux et que je ne m'y prends pas comme un commanche). Sinon vous pouvez aussi utiliser [Docker](https://www.docker.com/) avec les 2 commandes suivantes : ```bash -docker build -t 2ec0b4/kaamelott-soundboard . -docker run -it --rm --name kaamelott-soundboard -p 80:80 -t 2ec0b4/kaamelott-soundboard +make install +make start ``` -+ Pour les utilisateurs Windows 10 : Rendez-vous sur la page [http://localhost]() -+ Pour les utilisateurs Windows 7 : Rendez-vous sur la page [http://192.168.99.100]() +(cf. le fichier `Makefile`) Whoooohoooo woa c'est mortel ! diff --git a/docker-compose.builder.yml b/docker-compose.builder.yml new file mode 100644 index 0000000..b367252 --- /dev/null +++ b/docker-compose.builder.yml @@ -0,0 +1,16 @@ +version: '2' + +services: + base: + image: ks-base + volumes: + - .:/usr/src/service/ + working_dir: /usr/src/service/ + install: + extends: + service: base + command: bash -c "npm install && bower install --allow-root" + build: + extends: + service: base + command: bash -c "gulp init && gulp build"