Skip to content

Commit

Permalink
Fixed excessive CPU usage
Browse files Browse the repository at this point in the history
  • Loading branch information
Adrian Kosmaczewski committed Sep 4, 2023
1 parent a3de58e commit 93dfab2
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 11 deletions.
20 changes: 10 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
FROM ghcr.io/vshn/asciidoctor-slides:1.17.0

RUN addgroup -S preview && adduser -S preview -G preview
RUN mkdir -p /presentation && chown -R preview:preview /presentation
RUN mkdir -p /build && chown -R preview:preview /build
RUN addgroup -S preview && adduser -S preview -G preview && \
mkdir -p /presentation && chown -R preview:preview /presentation && \
mkdir -p /build && chown -R preview:preview /build

WORKDIR /build

# The libnotify requirement courtesy of
# https://github.com/bebraven/platform/pull/82/files
# to fix file system notification issues when running this image in a Mac

RUN apk update && apk add curl unzip build-base ruby-dev ruby-rdoc libnotify
RUN gem install guard guard-livereload guard-shell libnotify

RUN curl --silent --location https://github.com/caddyserver/caddy/releases/download/v2.4.6/caddy_2.4.6_linux_amd64.tar.gz -o /build/caddy.tar.gz
RUN tar -zxvf /build/caddy.tar.gz
RUN mv /build/caddy /usr/local/bin/caddy
RUN rm /build/caddy.tar.gz
RUN apk update && apk add curl unzip build-base ruby-dev ruby-rdoc libnotify && \
gem install --no-document guard guard-livereload guard-shell libnotify && \
apk del build-base ruby-dev && \
curl --silent --location https://github.com/caddyserver/caddy/releases/download/v2.4.6/caddy_2.4.6_linux_amd64.tar.gz -o /build/caddy.tar.gz && \
tar -zxvf /build/caddy.tar.gz && \
mv /build/caddy /usr/local/bin/caddy && \
rm /build/caddy.tar.gz

COPY slides-preview.sh /usr/local/bin/
COPY signal-listener.sh /usr/local/bin/
Expand Down
8 changes: 7 additions & 1 deletion Guardfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
# Very important!
ignore %r{^node_modules/}

group :presentation do
# Rebuild documentation when modifying files
guard :shell do
watch(/slides.adoc/) do
watch(/(.*).adoc/) do |a|
time = Time.new
timestring = time.strftime("%H:%M:%S")
puts "#{timestring} - INFO - Got change for: #{a[0]}"
`generate-vshn-slides --filename=slides.adoc`
end
end
Expand Down

0 comments on commit 93dfab2

Please sign in to comment.