diff --git a/.env b/.env new file mode 100644 index 000000000..062841d46 --- /dev/null +++ b/.env @@ -0,0 +1 @@ +COMPOSE_FILE=docker-compose.yml:docker-compose-dev.yml diff --git a/README.md b/README.md index f50d2ed03..30b51e756 100644 --- a/README.md +++ b/README.md @@ -31,3 +31,19 @@ bundle exec jekyll serve --livereload ``` Preview the site at http://127.0.0.1:4000. + + +## Local Docker Usage + +Install Dependencies: + +``` +docker compose run script bundle install +``` + + +Run the Jekyll server: + +``` +docker compose up +``` diff --git a/docker-compose-dev.yml b/docker-compose-dev.yml new file mode 100644 index 000000000..9578ad8dd --- /dev/null +++ b/docker-compose-dev.yml @@ -0,0 +1,10 @@ +version: "3" + +services: + app: + volumes: [ bundle:/usr/local/bundle ] + script: + volumes: [ bundle:/usr/local/bundle ] + +volumes: + bundle: diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 000000000..384ba0111 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,21 @@ +version: "3" + +services: + app: + image: ruby:2.7 + working_dir: /work + volumes: [ ".:/work" ] + command: "bundle exec jekyll serve --livereload --host=0.0.0.0" + ports: [ "4000:4000" ] + script: + image: ruby:2.7 + working_dir: /work + volumes: [ ".:/work" ] + stop_signal: SIGKILL + command: + - bash + - -c + - | + echo " + To execute a script, run: + docker-compose run script {command}"