-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile.dev
More file actions
83 lines (74 loc) · 2.67 KB
/
Copy pathDockerfile.dev
File metadata and controls
83 lines (74 loc) · 2.67 KB
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
FROM ruby:3.4.7-slim-bookworm AS base
# Install base packages + Chromium for PDF generation
RUN apt-get update -qq && \
apt-get install --no-install-recommends -y \
curl \
ghostscript \
imagemagick \
libjemalloc2 \
libvips \
postgresql-client \
# Chromium for Grover PDF generation
chromium \
chromium-driver \
# Required Chromium dependencies
fonts-liberation \
libappindicator3-1 \
libasound2 \
libatk-bridge2.0-0 \
libatk1.0-0 \
libcups2 \
libdbus-1-3 \
libnspr4 \
libnss3 \
libx11-xcb1 \
libxcomposite1 \
libxdamage1 \
libxrandr2 \
xdg-utils \
# PrinceXML install deps (prince_pdf plugin)
wget \
gdebi && \
ln -s /usr/lib/$(uname -m)-linux-gnu/libjemalloc.so.2 /usr/local/lib/libjemalloc.so && \
rm -rf /var/lib/apt/lists /var/cache/apt/archives
# Allow ImageMagick to read PDFs. Debian disables PDF/PS coders by default
# (CVE-2016-3714 hardening for untrusted-input use cases). We're rendering
# our own freshly-generated PDFs for thumbnailing, so the restriction is
# unnecessary here and blocks MaterialPdfJob#perform → Exporters::Thumbnail.
RUN sed -i 's/rights="none" pattern="PDF"/rights="read|write" pattern="PDF"/' /etc/ImageMagick-6/policy.xml
# PrinceXML for accessible PDF/UA-1 rendering (prince_pdf plugin).
# Multi-arch: amd64 + arm64. Pinned to Prince 16.1 / Debian 12.
# Unlicensed output is watermarked — set PRINCE_LICENSE_PATH at runtime.
# apt-get update is required here: the previous layer wipes /var/lib/apt/lists
# and gdebi needs the index to resolve Prince's deps (libaom3, etc.).
RUN set -e; \
SYSTEM_ARCH=$(dpkg --print-architecture); \
if [ "$SYSTEM_ARCH" = "amd64" ]; then PRINCE_ARCH="amd64"; \
elif [ "$SYSTEM_ARCH" = "arm64" ]; then PRINCE_ARCH="arm64"; \
else echo "Unsupported architecture: ${SYSTEM_ARCH}" >&2; exit 1; fi; \
PRINCE_DEB="prince_16-1_debian12_${PRINCE_ARCH}.deb"; \
apt-get update -qq; \
wget -q "https://www.princexml.com/download/${PRINCE_DEB}" -O "/tmp/${PRINCE_DEB}"; \
gdebi --non-interactive "/tmp/${PRINCE_DEB}"; \
rm "/tmp/${PRINCE_DEB}"; \
rm -rf /var/lib/apt/lists /var/cache/apt/archives
FROM base AS dev
# Install development packages
RUN apt-get update -qq && \
apt-get install --no-install-recommends -y \
build-essential \
git \
libpq-dev \
libyaml-dev \
postgresql-client \
curl \
shellcheck \
vim && \
rm -rf /var/lib/apt/lists /var/cache/apt/archives
WORKDIR /app
# Install Node.js
RUN curl -sL https://deb.nodesource.com/setup_22.x | bash - && \
apt-get install -y nodejs
# Install Yarn
RUN npm install -g yarn
CMD ["tail", "-f", "/dev/null"]