Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Docker-compose file for windows compatibility #875

Merged
merged 9 commits into from
Oct 31, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ For a hands-on walkthrough of al-folio installation, check out [this cool video

You need to take the following steps to get `al-folio` up and running in your local machine:

- First, [install docker](https://docs.docker.com/get-docker/)
- First, install [docker](https://docs.docker.com/get-docker/) and [docker-compose](https://docs.docker.com/compose/install/).
- Then, clone this repository to your machine:

```bash
Expand All @@ -139,12 +139,12 @@ $ cd <your-repo-name>
Finally, run the following command that will pull a pre-built image from DockerHub and will run your website.

```bash
$ ./bin/dockerhub_run.sh
$ docker-compose up
pourmand1376 marked this conversation as resolved.
Show resolved Hide resolved
```

Note that when you run it for the first time, it will download a docker image of size 300MB or so.

Now, feel free to customize the theme however you like (don't forget to change the name!). After you are done, you can use the same command (`bin/dockerhub_run.sh`) to render the webpage with all you changes. Also, make sure to commit your final changes.
Now, feel free to customize the theme however you like (don't forget to change the name!). After you are done, you can use the same command (`docker-compose up`) to render the webpage with all you changes. Also, make sure to commit your final changes.

<details><summary>(click to expand) <strong>Build your own docker image (more advanced):</strong></summary>

Expand All @@ -154,18 +154,18 @@ First, download the necessary modules and install them into a docker image calle


```bash
$ ./bin/docker_build_image.sh
$ docker-compose -f docker-local.yml build
```

Run the website!

```bash
$ ./bin/docker_run.sh
$ docker-compose -f docker-local.yml up
```

> To change port number, you can edit `docker_run.sh` file.
> To change port number, you can edit `docker-compose.yml` file.

> If you want to update jekyll, install new ruby packages, etc., all you have to do is build the image again using `docker_build_image.sh`! It will download ruby and jekyll and install all ruby packages again from scratch.
> If you want to update jekyll, install new ruby packages, etc., all you have to do is build the image again! It will download ruby and jekyll and install all ruby packages again from scratch.

</details>

Expand Down
3 changes: 2 additions & 1 deletion bin/docker_run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ if [ -f "$FILE" ]; then
fi
docker run --rm -v "$PWD:/srv/jekyll/" -p "8080:8080" \
-it al-folio:latest bundler \
exec jekyll serve --watch --port=8080 --host=0.0.0.0
exec jekyll serve --watch --port=8080 --host=0.0.0.0 \
--verbose --livereload
3 changes: 2 additions & 1 deletion bin/dockerhub_run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ if [ -f "$FILE" ]; then
fi
docker run --rm -v "$PWD:/srv/jekyll/" -p "8080:8080" \
-it amirpourmand/al-folio bundler \
exec jekyll serve --watch --port=8080 --host=0.0.0.0
exec jekyll serve --watch --port=8080 --host=0.0.0.0 \
--verbose --livereload
12 changes: 12 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version: "3"
# this file uses prebuilt image in dockerhub
services:
jekyll:
image: amirpourmand/al-folio
command: bash -c "
rm -f Gemfile.lock
&& bundler exec jekyll serve --watch --port=8080 --host=0.0.0.0 --livereload --verbose"
ports:
- 8080:8080
volumes:
- .:/srv/jekyll
12 changes: 12 additions & 0 deletions docker-local.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version: "3"

services:
jekyll_custom:
build: .
command: bash -c "
rm -f Gemfile.lock
&& bundler exec jekyll serve --watch --port=8080 --host=0.0.0.0 --livereload --verbose"
ports:
- 8080:8080
volumes:
- .:/srv/jekyll