Skip to content

Commit

Permalink
Containerize app (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
matthew-dong-dev authored Nov 21, 2024
1 parent dce774a commit d25c689
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 7 deletions.
19 changes: 19 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]
16 changes: 9 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,15 @@
<h2><a href="https://matthewydong.com ">Personal Website</a> · <img src="https://travis-ci.org/mdong127/mdong127.github.io.svg?branch=master" alt="Build Status" style="max-width:100%;"></a></h2>
</p>

> 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:

Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit d25c689

Please sign in to comment.