Giter Club home page Giter Club logo

peladen's Introduction

Netlify Status

peladen

Personal blog

Docker Usage

Run site locally

Run site locally to do changes with docker compose file docker/compose-dev.yml. Current directory will be mounted inside the container so any changes can be seen without rebuilding the image.

docker compose -f docker/compose-dev.yml up -d

And then open the site at http://127.0.0.1:1313

We can checks the hugo logs with:

docker compose -f docker/compose-dev.yml logs -f

Build to nginx image

To build the site, packaging it with nginx image and run locally, use docker compose file docker/compose-build.yml.

docker compose -f docker/compose-build.yml build

The resulting docker image can also be moved and run somewhere else.

Create new site

We can also create new site using docker compose file docker/compose-dev.yml with these modification:

  • Create a folder for the new site and copy the docker folder.
mkdir newblog
cp -r peladen/docker newblog/
cd newblog
  • Open docker/compose-dev.yml and comment out this entrypoint
#entrypoint: ["hugo", "server", "--bind=0.0.0.0", "--buildDrafts"]
  • Uncomment this entrypoint and tty
entrypoint: cat
...
tty: true
  • Run docker compose and go inside the container
docker compose -f docker/compose-dev.yml up -d
docker compose -f docker/compose-dev.yml exec hugo sh
  • Create new site
hugo new site . --force
  • Exit and stop container
exit
docker compose -f docker/compose-dev.yml down
  • Restore original entrypoint and comment out tty
entrypoint: ["hugo", "server", "--bind=0.0.0.0", "--buildDrafts"]
#entrypoint: cat
...
#tty: true
  • Run docker compose again and continue site development.
docker compose -f docker/compose-dev.yml up -d

License

The content of this project itself is licensed under the Creative Commons Attribution-ShareAlike 4.0 International license, and the underlying source code used to format and display that content is licensed under the GPL-3.0 license.

peladen's People

Contributors

bwk65535 avatar dependabot[bot] avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.