Skip to content

Commit 0629ee8

Browse files
authored
Merge pull request learningequality#5757 from bjester/rollback-prod-dockerfile
Rollback dockerfile to version from hotfixes
2 parents f45d9a6 + ec6e003 commit 0629ee8

1 file changed

Lines changed: 30 additions & 37 deletions

File tree

docker/Dockerfile.prod

Lines changed: 30 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,47 @@
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
152

163
# Set the timezone
174
RUN ln -fs /usr/share/zoneinfo/America/Los_Angeles /etc/localtime
185

19-
ENV DEBIAN_FRONTEND=noninteractive
6+
ENV DEBIAN_FRONTEND noninteractive
207
# 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
2210

11+
# Pin, Download and install node 18.x
2312
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
3622

37-
WORKDIR /contentcuration
23+
RUN corepack enable pnpm
3824

39-
COPY requirements.txt /contentcuration/
25+
COPY ./package.json .
26+
COPY ./pnpm-lock.yaml .
27+
RUN pnpm install
4028

41-
# Install Python dependencies
42-
RUN uv pip sync --system /contentcuration/requirements.txt
29+
COPY requirements.txt .
4330

44-
COPY . /contentcuration/
31+
RUN pip install --upgrade pip
32+
RUN pip install --ignore-installed -r requirements.txt
4533

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
4841

4942
ARG COMMIT_SHA
5043
ENV RELEASE_COMMIT_SHA=$COMMIT_SHA
5144

52-
EXPOSE 8081
45+
EXPOSE 8000
5346

54-
CMD ["make", "altprodserver"]
47+
ENTRYPOINT ["make", "altprodserver"]

0 commit comments

Comments
 (0)