reboot as pandoc-based markdown proj
This commit is contained in:
parent
c1e3bba6cf
commit
8882bbdc69
8 changed files with 110 additions and 140 deletions
28
Dockerfile
Normal file
28
Dockerfile
Normal file
|
@ -0,0 +1,28 @@
|
|||
FROM nginx:stable
|
||||
|
||||
RUN apt-get update && apt-get install -y \
|
||||
pandoc \
|
||||
--no-install-recommends && \
|
||||
apt-get clean && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
RUN mkdir -p /app/markdown
|
||||
|
||||
COPY *.md /app/markdown
|
||||
COPY *.md /usr/share/nginx/html
|
||||
COPY template.html /app/markdown
|
||||
|
||||
COPY default.conf /etc/nginx/conf.d
|
||||
|
||||
RUN for md_file in /app/markdown/*.md; do \
|
||||
if [ -f "$md_file" ]; then \
|
||||
filename=$(basename -- "$md_file"); \
|
||||
name="${filename%.*}"; \
|
||||
echo "Converting $filename to $name.html"; \
|
||||
pandoc "$md_file" -o "/usr/share/nginx/html/$name.html" \
|
||||
--template=/app/markdown/template.html \
|
||||
--standalone; \
|
||||
fi; \
|
||||
done
|
||||
|
||||
EXPOSE 80
|
Loading…
Add table
Add a link
Reference in a new issue