Put source code in ./site/
mkdir -p site/
docker run \
--volume "$PWD/site:/site" \
--workdir /site \
--entrypoint sh
docker.io/library/ruby:3.2 \
-c "gem install nanoc && nanoc create-site ."
source 'https://rubygems.org' | |
gem 'nanoc' | |
gem 'webrick' | |
gem 'adsf' | |
group 'nanoc' do | |
gem 'nanoc-live' | |
gem 'kramdown' | |
end |
DEV_IMAGE_TAG := nanoc-dev | |
RELEASE_IMAGE_TAG := docker.io/fowlmouth/nanoc-site:latest | |
dev-container: | |
docker build . --file nanoc.Dockerfile --tag "$(DEV_IMAGE_TAG)" --target build | |
release-container: | |
docker build . --file nanoc.Dockerfile --tag "$(RELEASE_IMAGE_TAG)" | |
dev: dev-container | |
docker run --interactive --tty \ | |
--volume "$(PWD)/site:/site" --workdir /site \ | |
--publish '33000:3000' \ | |
"$(DEV_IMAGE_TAG)" \ | |
bundler exec nanoc live --host 0.0.0.0 |
FROM docker.io/library/ruby:3.2 AS build | |
ADD Gemfile* ./ | |
RUN bundle install | |
WORKDIR /src | |
ADD site/ ./ | |
RUN bundler exec nanoc compile | |
FROM docker.io/library/nginx:1.21 AS main | |
COPY --from=build /src/output /usr/share/nginx/html/ |