From ac03e2cb6fb3039b021dc5a2232b82dec59ab492 Mon Sep 17 00:00:00 2001 From: James Estevez Date: Mon, 11 Nov 2024 13:17:04 -0800 Subject: [PATCH] Copy/paste pyjs dockerfile --- Dockerfile | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 6c8b60246..c1c12cdf3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,33 @@ -FROM ghcr.io/oddbird/pyjs:py3.9-node22 - ARG BUILD_ENV=development ARG PROD_ASSETS ARG OMNIOUT_TOKEN +FROM node:22 AS node_base +FROM python:3.9 + +# Node and npm +COPY --from=node_base /usr/local/lib/node_modules /usr/local/lib/node_modules +COPY --from=node_base /usr/local/bin/node /usr/local/bin/node +COPY --from=node_base /opt/yarn-* /opt/yarn +RUN ln -s /usr/local/lib/node_modules/corepack/dist/corepack.js /usr/local/bin/corepack +RUN ln -s /usr/local/lib/node_modules/npm/bin/npm-cli.js /usr/local/bin/npm +RUN ln -s /usr/local/lib/node_modules/npm/bin/npx-cli.js /usr/local/bin/npx +RUN ln -s /opt/yarn/bin/yarn /usr/local/bin/yarn +RUN ln -s /opt/yarn/bin/yarnpkg /usr/local/bin/yarnpkg +RUN node --version && npm --version && yarn --version + +# System setup: +RUN apt-get update \ + && apt-get install -y gettext redis-tools --no-install-recommends \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* + +# Python context setup: +RUN pip install --no-cache-dir --upgrade pip pip-tools + +# ================ ENVIRONMENT +ENV PYTHONUNBUFFERED 1 +ENV PYTHONDONTWRITEBYTECODE 1 + WORKDIR /app # Env setup: