|
1 | | -FROM node:20-trixie-slim AS node-builder |
2 | | - |
3 | | -WORKDIR /contentcuration |
4 | | - |
5 | | -COPY package.json pnpm-lock.yaml ./ |
6 | | -RUN corepack enable pnpm && pnpm install --frozen-lockfile |
7 | | - |
8 | | -COPY . . |
9 | | - |
10 | | -# The webpack build, creating the frontend assets, later copied to the final image |
11 | | -RUN pnpm run build |
12 | | - |
13 | | - |
14 | | -FROM ghcr.io/astral-sh/uv:python3.10-trixie-slim |
| 1 | +FROM python:3.10-slim-bookworm |
15 | 2 |
|
16 | 3 | # Set the timezone |
17 | 4 | RUN ln -fs /usr/share/zoneinfo/America/Los_Angeles /etc/localtime |
18 | 5 |
|
19 | | -ENV DEBIAN_FRONTEND=noninteractive |
| 6 | +ENV DEBIAN_FRONTEND noninteractive |
20 | 7 | # Default Python file.open file encoding to UTF-8 instead of ASCII, workaround for le-utils setup.py issue |
21 | | -ENV LANG=C.UTF-8 |
| 8 | +ENV LANG C.UTF-8 |
| 9 | +RUN apt-get update && apt-get -y install python3-pip python3-dev gcc libpq-dev libssl-dev libffi-dev make git curl libjpeg-dev ffmpeg |
22 | 10 |
|
| 11 | +# Pin, Download and install node 18.x |
23 | 12 | RUN apt-get update \ |
24 | | - && apt-get -y install --no-install-recommends \ |
25 | | - gcc \ |
26 | | - libpq-dev \ |
27 | | - libssl-dev \ |
28 | | - libffi-dev \ |
29 | | - make \ |
30 | | - git \ |
31 | | - curl \ |
32 | | - gettext \ |
33 | | - libjpeg-dev \ |
34 | | - ffmpeg \ |
35 | | - && rm -rf /var/lib/apt/lists/* |
| 13 | + && apt-get install -y ca-certificates curl gnupg \ |
| 14 | + && mkdir -p /etc/apt/keyrings \ |
| 15 | + && curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg \ |
| 16 | + && echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_20.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list \ |
| 17 | + && echo "Package: nodejs" >> /etc/apt/preferences.d/preferences \ |
| 18 | + && echo "Pin: origin deb.nodesource.com" >> /etc/apt/preferences.d/preferences \ |
| 19 | + && echo "Pin-Priority: 1001" >> /etc/apt/preferences.d/preferences\ |
| 20 | + && apt-get update \ |
| 21 | + && apt-get install -y nodejs |
36 | 22 |
|
37 | | -WORKDIR /contentcuration |
| 23 | +RUN corepack enable pnpm |
38 | 24 |
|
39 | | -COPY requirements.txt /contentcuration/ |
| 25 | +COPY ./package.json . |
| 26 | +COPY ./pnpm-lock.yaml . |
| 27 | +RUN pnpm install |
40 | 28 |
|
41 | | -# Install Python dependencies |
42 | | -RUN uv pip sync --system /contentcuration/requirements.txt |
| 29 | +COPY requirements.txt . |
43 | 30 |
|
44 | | -COPY . /contentcuration/ |
| 31 | +RUN pip install --upgrade pip |
| 32 | +RUN pip install --ignore-installed -r requirements.txt |
45 | 33 |
|
46 | | -# Copy compiled frontend static output from node-builder |
47 | | -COPY --from=node-builder /contentcuration/contentcuration/contentcuration/static /contentcuration/contentcuration/contentcuration/static |
| 34 | +COPY . /contentcuration/ |
| 35 | +WORKDIR /contentcuration |
| 36 | + |
| 37 | +# generate the node bundles |
| 38 | +RUN mkdir -p contentcuration/static/js/bundles |
| 39 | +RUN ln -s /node_modules /contentcuration/node_modules |
| 40 | +RUN pnpm run build |
48 | 41 |
|
49 | 42 | ARG COMMIT_SHA |
50 | 43 | ENV RELEASE_COMMIT_SHA=$COMMIT_SHA |
51 | 44 |
|
52 | | -EXPOSE 8081 |
| 45 | +EXPOSE 8000 |
53 | 46 |
|
54 | | -CMD ["make", "altprodserver"] |
| 47 | +ENTRYPOINT ["make", "altprodserver"] |
0 commit comments