mirror of
https://github.com/penpot/penpot.git
synced 2026-09-11 06:28:47 +00:00
🐳 Migrate media-processor images to DHI
This commit is contained in:
parent
b4dc8207ff
commit
b3f5d83b54
@ -1,17 +1,16 @@
|
|||||||
FROM ubuntu:26.04
|
# syntax=docker/dockerfile:1
|
||||||
|
FROM dhi.io/node:24.18.0-debian13-dev
|
||||||
LABEL maintainer="Penpot <docker@penpot.app>"
|
LABEL maintainer="Penpot <docker@penpot.app>"
|
||||||
|
|
||||||
ENV LANG=en_US.UTF-8 \
|
ENV LANG=en_US.UTF-8 \
|
||||||
LC_ALL=en_US.UTF-8 \
|
LC_ALL=en_US.UTF-8 \
|
||||||
NODE_VERSION=v24.18.0 \
|
DEBIAN_FRONTEND=noninteractive
|
||||||
DEBIAN_FRONTEND=noninteractive \
|
|
||||||
PATH=/opt/node/bin:$PATH
|
|
||||||
|
|
||||||
|
# passwd provides useradd, not preinstalled on the DHI base image.
|
||||||
RUN set -ex; \
|
RUN set -ex; \
|
||||||
useradd -U -M -u 1001 -s /bin/false -d /opt/penpot penpot; \
|
|
||||||
mkdir -p /etc/resolvconf/resolv.conf.d; \
|
|
||||||
echo "nameserver 127.0.0.11" > /etc/resolvconf/resolv.conf.d/tail; \
|
|
||||||
apt-get -qq update; \
|
apt-get -qq update; \
|
||||||
|
apt-get -qqy --no-install-recommends install passwd; \
|
||||||
|
useradd -U -M -u 1001 -s /bin/false -d /opt/penpot penpot; \
|
||||||
apt-get -qq dist-upgrade; \
|
apt-get -qq dist-upgrade; \
|
||||||
apt-get -qqy --no-install-recommends install \
|
apt-get -qqy --no-install-recommends install \
|
||||||
curl \
|
curl \
|
||||||
@ -34,7 +33,7 @@ RUN set -ex; \
|
|||||||
\
|
\
|
||||||
libgomp1 \
|
libgomp1 \
|
||||||
libheif1 \
|
libheif1 \
|
||||||
libjpeg-turbo8 \
|
libjpeg62-turbo \
|
||||||
liblcms2-2 \
|
liblcms2-2 \
|
||||||
libopenexr-3-1-30 \
|
libopenexr-3-1-30 \
|
||||||
libopenjp2-7 \
|
libopenjp2-7 \
|
||||||
@ -44,34 +43,12 @@ RUN set -ex; \
|
|||||||
libwebp7 \
|
libwebp7 \
|
||||||
libwebpdemux2 \
|
libwebpdemux2 \
|
||||||
libwebpmux3 \
|
libwebpmux3 \
|
||||||
libxml2-16 \
|
libxml2 \
|
||||||
libzip5 \
|
libzip5 \
|
||||||
libzstd1 \
|
libzstd1 \
|
||||||
; \
|
; \
|
||||||
apt-get clean; \
|
apt-get clean; \
|
||||||
rm -rf /var/lib/apt/lists/*;
|
rm -rf /var/lib/apt/lists/*; \
|
||||||
|
|
||||||
RUN set -eux; \
|
|
||||||
ARCH="$(dpkg --print-architecture)"; \
|
|
||||||
case "${ARCH}" in \
|
|
||||||
aarch64|arm64) \
|
|
||||||
BINARY_URL="https://nodejs.org/dist/${NODE_VERSION}/node-${NODE_VERSION}-linux-arm64.tar.gz"; \
|
|
||||||
;; \
|
|
||||||
amd64|x86_64) \
|
|
||||||
BINARY_URL="https://nodejs.org/dist/${NODE_VERSION}/node-${NODE_VERSION}-linux-x64.tar.gz"; \
|
|
||||||
;; \
|
|
||||||
*) \
|
|
||||||
echo "Unsupported arch: ${ARCH}"; \
|
|
||||||
exit 1; \
|
|
||||||
;; \
|
|
||||||
esac; \
|
|
||||||
curl -LfsSo /tmp/nodejs.tar.gz ${BINARY_URL}; \
|
|
||||||
mkdir -p /opt/node; \
|
|
||||||
cd /opt/node; \
|
|
||||||
tar -xf /tmp/nodejs.tar.gz --strip-components=1; \
|
|
||||||
chown -R root /opt/node; \
|
|
||||||
rm -rf /tmp/nodejs.tar.gz; \
|
|
||||||
corepack enable; \
|
|
||||||
mkdir -p /opt/penpot; \
|
mkdir -p /opt/penpot; \
|
||||||
chown -R penpot:penpot /opt/penpot;
|
chown -R penpot:penpot /opt/penpot;
|
||||||
|
|
||||||
@ -79,8 +56,11 @@ ARG BUNDLE_PATH="./bundle-media-processor/"
|
|||||||
COPY --chown=penpot:penpot $BUNDLE_PATH /opt/penpot/media-processor/
|
COPY --chown=penpot:penpot $BUNDLE_PATH /opt/penpot/media-processor/
|
||||||
|
|
||||||
WORKDIR /opt/penpot/media-processor
|
WORKDIR /opt/penpot/media-processor
|
||||||
|
|
||||||
|
# Runs as root: this base image installs Node system-wide (symlinked into
|
||||||
|
# /usr/bin), so ./setup's internal `corepack enable` needs write access there.
|
||||||
|
RUN ./setup && chown -R penpot:penpot /opt/penpot/media-processor
|
||||||
|
|
||||||
USER penpot:penpot
|
USER penpot:penpot
|
||||||
|
|
||||||
RUN ./setup
|
|
||||||
|
|
||||||
CMD ["node", "dist/index.js"]
|
CMD ["node", "dist/index.js"]
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user