https://github.com/LittleNewton/hexo
819
This is a modern Debian-based container image.
FROM debian:trixie
# Set environment variables
ENV HEXO_SERVER_PORT=4000 \
NODE_VERSION=24
# These will be provided at runtime via docker run -e or docker-compose
ENV GIT_USER="" \
GIT_EMAIL="" \
TZ="UTC"
# Install dependencies
RUN apt-get update && apt-get install -y \
curl \
git \
ca-certificates \
gnupg \
&& rm -rf /var/lib/apt/lists/*
# Install Node.js from NodeSource
RUN curl -fsSL https://deb.nodesource.com/setup_${NODE_VERSION}.x | bash - \
&& apt-get install -y nodejs \
&& rm -rf /var/lib/apt/lists/*
# Install hexo-cli globally
RUN npm install hexo-cli -g
# Preconfigure SSH known_hosts for GitHub
RUN set -eux; \
mkdir -p /root/.ssh; \
ssh-keyscan -t rsa,ecdsa,ed25519 -p 443 ssh.github.com >> /root/.ssh/known_hosts ; \
chmod 600 /root/.ssh/known_hosts
# Copy ssh config
COPY ssh_config /root/.ssh/config
RUN chmod 600 /root/.ssh/config
# Create entrypoint script to configure git and timezone at runtime
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
# Set working directory
WORKDIR /app
# Expose Hexo server port
EXPOSE ${HEXO_SERVER_PORT}
# Default command to start Hexo server
CMD ["hexo", "server", "--cwd", "/app"]
Content type
Image
Digest
sha256:175371b07…
Size
193.6 MB
Last updated
11 months ago
docker pull littlenewton/hexo