-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
26 lines (19 loc) · 1.11 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
FROM python:3.10-slim
# This Dockerfile exists because pandoc mermaid-filter is extremely finicky to get working
# Instead of fighting to get it working (and keep it working), we just use this container as a build environment
RUN apt-get update && \
apt-get install -y build-essential curl git pandoc chromium && \
curl -fsSL https://deb.nodesource.com/setup_19.x | bash - && \
apt-get install -y nodejs
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true \
PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium
WORKDIR /app
COPY pyproject.toml poetry.lock ./
RUN curl -sSL https://install.python-poetry.org | python3 - && \
/root/.local/bin/poetry config virtualenvs.create false && \
/root/.local/bin/poetry install --no-interaction --no-ansi && \
npm install -g --save-exact esbuild mermaid-filter --unsafe-perm
RUN echo '{"args": ["--no-sandbox","--disable-setuid-sandbox"],"executablePath": "/usr/bin/chromium"}' > /tmp/.puppeteer.json
RUN printf '#!/bin/sh\ncp /tmp/.puppeteer.json . && make -B' > /tmp/build.sh && chmod +x /tmp/build.sh
ENV PATH="${PATH}:/root/.local/bin:/app/node_modules/.bin"
CMD ["/tmp/build.sh"]