From 08fe866912c03eea36b96bc1e33318b16a1a2e24 Mon Sep 17 00:00:00 2001 From: Jack Ellis Date: Mon, 22 Jan 2024 19:19:14 +0000 Subject: [PATCH 1/2] mo' better docker --- Dockerfile | 7 +++++++ _bin/install | 5 +++++ _bin/serve | 3 +++ docker-compose.yml | 22 ++++++++++++++++++++++ 4 files changed, 37 insertions(+) create mode 100644 Dockerfile create mode 100755 _bin/install create mode 100755 _bin/serve create mode 100644 docker-compose.yml diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..22ca19c --- /dev/null +++ b/Dockerfile @@ -0,0 +1,7 @@ +FROM ruby:2.7.0 + +WORKDIR /srv/jekyll + +COPY . . + +RUN bundle config path vendor/bundle diff --git a/_bin/install b/_bin/install new file mode 100755 index 0000000..ca81d55 --- /dev/null +++ b/_bin/install @@ -0,0 +1,5 @@ +#!/usr/bin/env sh + +rm -rf ./vendor +docker-compose up -d --build +docker-compose exec app bundle install \ No newline at end of file diff --git a/_bin/serve b/_bin/serve new file mode 100755 index 0000000..a5f8066 --- /dev/null +++ b/_bin/serve @@ -0,0 +1,3 @@ +#!/usr/bin/env sh + +docker-compose exec app bundle exec jekyll server --host 0.0.0.0 \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..2b1d653 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,22 @@ +version: '3' + +services: + app: + platform: linux/x86_64 + build: + context: . + dockerfile: Dockerfile + volumes: + - "./:/srv/jekyll" + ports: + - "4000:4000" + networks: + - website-network + entrypoint: tail -f /dev/null + environment: + EXECJS_RUNTIME: Disabled + +networks: + website-network: + driver: bridge + \ No newline at end of file From f53efea2d0d4583b3ac3b8804be60ed155d7d206 Mon Sep 17 00:00:00 2001 From: Jack Ellis Date: Mon, 22 Jan 2024 19:20:20 +0000 Subject: [PATCH 2/2] Fix port --- _bin/serve | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/_bin/serve b/_bin/serve index a5f8066..5133119 100755 --- a/_bin/serve +++ b/_bin/serve @@ -1,3 +1,6 @@ #!/usr/bin/env sh -docker-compose exec app bundle exec jekyll server --host 0.0.0.0 \ No newline at end of file +docker-compose exec app \ + bundle exec jekyll server \ + --host 0.0.0.0 \ + --port 4000 \ No newline at end of file