From fe799a36e6b59598783984a6032b029bdaa49db0 Mon Sep 17 00:00:00 2001 From: bassco Date: Sun, 9 Aug 2020 16:58:57 +0200 Subject: [PATCH 1/2] Setup docker-compose local development --- Dockerfile.php | 3 +++ README.md | 19 +++++++++++++++++++ docker-compose.yml | 26 ++++++++++++++++++++++++++ 3 files changed, 48 insertions(+) create mode 100644 Dockerfile.php create mode 100644 docker-compose.yml diff --git a/Dockerfile.php b/Dockerfile.php new file mode 100644 index 0000000..5e45d50 --- /dev/null +++ b/Dockerfile.php @@ -0,0 +1,3 @@ +FROM php:7.4-apache + +WORKDIR /var/www/html diff --git a/README.md b/README.md index bf42678..d113fd9 100644 --- a/README.md +++ b/README.md @@ -43,3 +43,22 @@ npm run build If you wish to enhance this tool, please feel free to do so - generally this is appreciated. However, pull requests will be only accepted if they are clean and match the used coding/markup style. +## Docker compose setup + +By using docker-compose we can run a local development environment without installing any software on the local machine, apart from docker and docker-compose. + +Install and build the Vue application + +```shell +docker-compose run --rm npm install +docker-compose run --rm npm run build +``` + +Start the web server to serve the content + +```shell +docker-compose up web -d +open http://localhost:8080 +``` + + diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..401b495 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,26 @@ +version: '3' +networks: + configtool: + +services: + web: + image: php:7.4-apache + container_name: php + volumes: + - ./dist:/var/www/html + ports: + - "8080:80" + networks: + - configtool + + npm: + image: node:13.7 + container_name: npm + environment: + NODE_ENV: "dev" + volumes: + - ./:/var/www/html + working_dir: /var/www/html + entrypoint: ['npm', '--no-bin-files'] + networks: + - configtool From 9d2e970bb02f047b1e9e195aba6f4d4ecf24cf19 Mon Sep 17 00:00:00 2001 From: bassco Date: Sun, 9 Aug 2020 20:19:13 +0200 Subject: [PATCH 2/2] Simplify the dev env --- Dockerfile.php | 3 --- README.md | 11 ++++++++++- docker-compose.yml | 2 +- 3 files changed, 11 insertions(+), 5 deletions(-) delete mode 100644 Dockerfile.php diff --git a/Dockerfile.php b/Dockerfile.php deleted file mode 100644 index 5e45d50..0000000 --- a/Dockerfile.php +++ /dev/null @@ -1,3 +0,0 @@ -FROM php:7.4-apache - -WORKDIR /var/www/html diff --git a/README.md b/README.md index d113fd9..1056b18 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,9 @@ npm run build If you wish to enhance this tool, please feel free to do so - generally this is appreciated. However, pull requests will be only accepted if they are clean and match the used coding/markup style. -## Docker compose setup +## Docker local development environment + +### docker-compose setup By using docker-compose we can run a local development environment without installing any software on the local machine, apart from docker and docker-compose. @@ -61,4 +63,11 @@ docker-compose up web -d open http://localhost:8080 ``` +### docker-compose tear down + +Remove the running container + +```shell +docker-compose down -rm +``` diff --git a/docker-compose.yml b/docker-compose.yml index 401b495..38ce744 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -5,7 +5,7 @@ networks: services: web: image: php:7.4-apache - container_name: php + container_name: web volumes: - ./dist:/var/www/html ports: