From d25c689d1397fb92ad86cfa0e6b5e5dddf3f93c1 Mon Sep 17 00:00:00 2001
From: matthew-dong-dev <20007534+matthew-dong-dev@users.noreply.github.com>
Date: Thu, 21 Nov 2024 16:17:34 -0600
Subject: [PATCH] Containerize app (#11)
---
Dockerfile | 19 +++++++++++++++++++
README.md | 16 +++++++++-------
2 files changed, 28 insertions(+), 7 deletions(-)
create mode 100644 Dockerfile
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 0000000..f99f68b
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,19 @@
+FROM ruby:2.5.1
+
+ENV LANG=C.UTF-8
+
+RUN gem install bundler -v 2.3.27
+
+WORKDIR /app
+
+COPY Gemfile Gemfile.lock /app/
+
+RUN bundle install
+
+COPY . /app
+
+RUN bundle exec jekyll build
+
+EXPOSE 4000
+
+CMD ["bundle", "exec", "jekyll", "serve", "--host", "0.0.0.0"]
\ No newline at end of file
diff --git a/README.md b/README.md
index 5b1230d..3a84872 100755
--- a/README.md
+++ b/README.md
@@ -2,7 +2,15 @@
-> Run `bundle exec jekyll serve --config _config.yml,_config-dev.yml` for dev environment
+## Build & deployment
+
+`docker build -t personal-website:1.0.0 .`
+
+`docker run -p 4000:4000 personal-website:1.0.0 `
+
+## Local development
+
+Run `bundle exec jekyll serve --config _config.yml,_config-dev.yml` for dev environment
Notes:
@@ -78,12 +86,6 @@ Jekyll:
- `jekyll build` ?
"jekyll build will wipe everything in /_sites/. The first step of jekyll build is to delete everything in /_sites/ and then build it all again from scratch. So, you can’t store any files in there and expect them to stick around. Everything that goes into /_sites/ should be generated by Jekyll_"
-Git:
-
-- `git remote set-url origin git://new.url.here`
-- `git pull origin branchname --allow-unrelated-histories`
-- `git reset` only changes local repo, cannot push changes if you reset to a specific commit, need to use `git revert` (https://stackoverflow.com/a/22683231/6521206)
-
---
# FAQ: