From e186e2cb6b471c5526f0ff83128b1ae47431d20a Mon Sep 17 00:00:00 2001 From: Ella Soccoli Date: Sat, 20 Jan 2024 14:37:46 -0500 Subject: [PATCH 1/4] Updated instructions for running locally --- README.md | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 77f8993..a6e15eb 100644 --- a/README.md +++ b/README.md @@ -9,24 +9,33 @@ This site is written using [Jekyll](https://jekyllrb.com/), a static site genera ## Local Development #### Prerequisites: -1. [Ruby](https://www.ruby-lang.org/en/documentation/installation/) -2. [Bundler](https://bundler.io/) (`gem install bundler`) + +1. [Docker](https://docker.com) or [Podman](https://podman.io) #### Instructions -1. `bundle install` -2. Add necessary environment variables (they MUST be defined!!!): - * `export CSHPUBSITE_ASSETS_URL="https://assets.csh.rit.edu/pubsite"` - * `export CSHPUBSITE_S3_URL="https://s3.csh.rit.edu"` -3. `bundle exec jekyll serve` -The site should now serve locally at `localhost:4000`, and auto-build when you change/create files in the repo! +First, run the following command in the directory containing the Dockerfile to build the container + +``` +podman build -t public-site . +``` + +Next, run the following command to start the container + +``` +podman run -p 8080:80 public-site:latest +``` + +The site should now serve locally at `localhost:8080`. + +**Note**: If you are using Docker instead of Podman, replace `podman` in each command with `docker` ## Contributing 1. [Fork](https://help.github.com/en/articles/fork-a-repo) this repository - - Optionally create a new [git branch](https://git-scm.com/book/en/v2/Git-Branching-Branches-in-a-Nutshell) if your change is more than a small tweak (`git checkout -b BRANCH-NAME-HERE`) -3. Make your changes locally, commit, and push to your fork -4. Create a [Pull Request](https://help.github.com/en/articles/about-pull-requests) on this repo for our Webmasters to review + - Optionally create a new [git branch](https://git-scm.com/book/en/v2/Git-Branching-Branches-in-a-Nutshell) if your change is more than a small tweak (`git checkout -b BRANCH-NAME-HERE`) +2. Make your changes locally, commit, and push to your fork +3. Create a [Pull Request](https://help.github.com/en/articles/about-pull-requests) on this repo for our Webmasters to review ## Questions/Concerns From a03fb601503291ca52a10dbdb305553557cee406 Mon Sep 17 00:00:00 2001 From: Ella Soccoli <112343747+esoccoli@users.noreply.github.com> Date: Sat, 20 Jan 2024 15:02:53 -0500 Subject: [PATCH 2/4] Readded instructions for running locally without a container --- README.md | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index a6e15eb..b311b7c 100644 --- a/README.md +++ b/README.md @@ -9,33 +9,39 @@ This site is written using [Jekyll](https://jekyllrb.com/), a static site genera ## Local Development #### Prerequisites: - -1. [Docker](https://docker.com) or [Podman](https://podman.io) +1. [Ruby](https://www.ruby-lang.org/en/documentation/installation/) +2. [Bundler](https://bundler.io/) (`gem install bundler`) #### Instructions +1. `bundle install` +2. Add necessary environment variables (they MUST be defined!!!): + * `export CSHPUBSITE_ASSETS_URL="https://assets.csh.rit.edu/pubsite"` + * `export CSHPUBSITE_S3_URL="https://s3.csh.rit.edu"` +3. `bundle exec jekyll serve` + +The site should now serve locally at `localhost:8080`, and auto-build when you change/create files in the repo! + +### Running in a container -First, run the following command in the directory containing the Dockerfile to build the container +To run this site in a container, make sure you have either [Podman](https://podman.io) or [Docker](https://docker.com) installed. +First, build the container with the following command ``` podman build -t public-site . ``` -Next, run the following command to start the container - +Then, run the container with the following command ``` podman run -p 8080:80 public-site:latest ``` - -The site should now serve locally at `localhost:8080`. - -**Note**: If you are using Docker instead of Podman, replace `podman` in each command with `docker` +The site should now serve locally at `localhost:8080`. Note that it will not update when you make changes. You will have to stop the container and rebuild it to see your changes ## Contributing 1. [Fork](https://help.github.com/en/articles/fork-a-repo) this repository - - Optionally create a new [git branch](https://git-scm.com/book/en/v2/Git-Branching-Branches-in-a-Nutshell) if your change is more than a small tweak (`git checkout -b BRANCH-NAME-HERE`) -2. Make your changes locally, commit, and push to your fork -3. Create a [Pull Request](https://help.github.com/en/articles/about-pull-requests) on this repo for our Webmasters to review + - Optionally create a new [git branch](https://git-scm.com/book/en/v2/Git-Branching-Branches-in-a-Nutshell) if your change is more than a small tweak (`git checkout -b BRANCH-NAME-HERE`) +3. Make your changes locally, commit, and push to your fork +4. Create a [Pull Request](https://help.github.com/en/articles/about-pull-requests) on this repo for our Webmasters to review ## Questions/Concerns From 5936b9a94b0364a2dc6e957fcffc6948f69653cd Mon Sep 17 00:00:00 2001 From: Ella Soccoli Date: Tue, 23 Jan 2024 13:46:51 -0500 Subject: [PATCH 3/4] Fixed port for local development without a container --- README.md | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index b311b7c..2af7a44 100644 --- a/README.md +++ b/README.md @@ -9,39 +9,44 @@ This site is written using [Jekyll](https://jekyllrb.com/), a static site genera ## Local Development #### Prerequisites: + 1. [Ruby](https://www.ruby-lang.org/en/documentation/installation/) 2. [Bundler](https://bundler.io/) (`gem install bundler`) #### Instructions + 1. `bundle install` 2. Add necessary environment variables (they MUST be defined!!!): - * `export CSHPUBSITE_ASSETS_URL="https://assets.csh.rit.edu/pubsite"` - * `export CSHPUBSITE_S3_URL="https://s3.csh.rit.edu"` + - `export CSHPUBSITE_ASSETS_URL="https://assets.csh.rit.edu/pubsite"` + - `export CSHPUBSITE_S3_URL="https://s3.csh.rit.edu"` 3. `bundle exec jekyll serve` -The site should now serve locally at `localhost:8080`, and auto-build when you change/create files in the repo! +The site should now serve locally at `localhost:4000`, and auto-build when you change/create files in the repo! ### Running in a container To run this site in a container, make sure you have either [Podman](https://podman.io) or [Docker](https://docker.com) installed. First, build the container with the following command + ``` podman build -t public-site . ``` Then, run the container with the following command + ``` podman run -p 8080:80 public-site:latest ``` + The site should now serve locally at `localhost:8080`. Note that it will not update when you make changes. You will have to stop the container and rebuild it to see your changes ## Contributing 1. [Fork](https://help.github.com/en/articles/fork-a-repo) this repository - - Optionally create a new [git branch](https://git-scm.com/book/en/v2/Git-Branching-Branches-in-a-Nutshell) if your change is more than a small tweak (`git checkout -b BRANCH-NAME-HERE`) -3. Make your changes locally, commit, and push to your fork -4. Create a [Pull Request](https://help.github.com/en/articles/about-pull-requests) on this repo for our Webmasters to review + - Optionally create a new [git branch](https://git-scm.com/book/en/v2/Git-Branching-Branches-in-a-Nutshell) if your change is more than a small tweak (`git checkout -b BRANCH-NAME-HERE`) +2. Make your changes locally, commit, and push to your fork +3. Create a [Pull Request](https://help.github.com/en/articles/about-pull-requests) on this repo for our Webmasters to review ## Questions/Concerns From a47328941b613efc05ae7423d3a36fc744848dd9 Mon Sep 17 00:00:00 2001 From: Ella Soccoli Date: Tue, 23 Jan 2024 18:20:21 -0500 Subject: [PATCH 4/4] added -it to podman run command --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2af7a44..ce59c7f 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ podman build -t public-site . Then, run the container with the following command ``` -podman run -p 8080:80 public-site:latest +podman run -p 8080:80 -it public-site:latest ``` The site should now serve locally at `localhost:8080`. Note that it will not update when you make changes. You will have to stop the container and rebuild it to see your changes