|
| 1 | +# Use the base image with Node 22 and ns-upgrade pre-installed |
| 2 | +FROM ns-upgrade-test-base:latest |
| 3 | + |
| 4 | +ENV DEBIAN_FRONTEND=noninteractive |
| 5 | + |
| 6 | +# Install Node.js 8.17.0 from binary |
| 7 | +RUN curl -fsSL https://nodejs.org/dist/v8.17.0/node-v8.17.0-linux-x64.tar.xz -o /tmp/node.tar.xz && \ |
| 8 | + tar -xJf /tmp/node.tar.xz -C /usr/local --strip-components=1 && \ |
| 9 | + rm /tmp/node.tar.xz |
| 10 | + |
| 11 | +# Verify Node.js 8 installation |
| 12 | +RUN node --version && npm --version && \ |
| 13 | + echo "✓ Node 8 installed as system Node" |
| 14 | + |
| 15 | +# Install build dependencies for native modules (sqlite3, etc.) |
| 16 | +# Python 2 is usually required for Node 8 native modules |
| 17 | +RUN apt-get update && apt-get install -y \ |
| 18 | + python \ |
| 19 | + make \ |
| 20 | + g++ \ |
| 21 | + && rm -rf /var/lib/apt/lists/* |
| 22 | + |
| 23 | +# Download Ghost v1.25.5 |
| 24 | +WORKDIR /workspace/ghost |
| 25 | +# Download Ghost v1.25.5 with submodules (needed for default theme) |
| 26 | +WORKDIR /workspace/ghost |
| 27 | +RUN git clone --recurse-submodules --branch 1.25.5 https://github.com/TryGhost/Ghost.git . |
| 28 | + |
| 29 | +# Install Yarn and knex-migrator globally |
| 30 | +RUN npm install -g yarn knex-migrator |
| 31 | + |
| 32 | +# Install Ghost dependencies and run setup |
| 33 | +# --unsafe-perm is often needed when running as root |
| 34 | +RUN echo "Installing Ghost dependencies with Yarn" && \ |
| 35 | + yarn setup |
| 36 | + |
| 37 | +# Verify complete environment |
| 38 | +RUN node --version && \ |
| 39 | + /opt/node22/bin/node --version && \ |
| 40 | + echo "✓ System Node 8, Node 22 at /opt/node22 for CLI" |
| 41 | + |
| 42 | +# Set environment variables |
| 43 | +ENV SCENARIO_NAME=node8-ghost |
| 44 | +ENV VERSION_MANAGER=none |
| 45 | +ENV server__host=0.0.0.0 |
| 46 | +ENV server__port=2368 |
| 47 | + |
| 48 | +# Default: show info and instructions |
| 49 | +EXPOSE 2368 |
| 50 | +CMD ["/workspace/info.sh"] |
0 commit comments