31 lines
924 B
Docker
31 lines
924 B
Docker
# Dockerfile ÓÅ»¯°æ±¾²âÊÔ
|
|
FROM ubuntu:22.04 AS builder
|
|
|
|
ENV DEBIAN_FRONTEND=noninteractive
|
|
|
|
RUN apt-get update && apt-get install -y nginx-light curl && \
|
|
rm -rf /var/lib/apt/lists/*
|
|
|
|
RUN mkdir -p /app
|
|
|
|
RUN echo '#!/bin/bash' > /app/start.sh && \
|
|
echo 'echo "Starting optimized container..."' >> /app/start.sh && \
|
|
echo 'nginx -g "daemon off;"' >> /app/start.sh && \
|
|
chmod +x /app/start.sh
|
|
|
|
FROM ubuntu:22.04
|
|
|
|
RUN apt-get update && apt-get install -y nginx-light curl && \
|
|
rm -rf /var/lib/apt/lists/* && \
|
|
mkdir -p /var/www/html
|
|
|
|
COPY --from=builder /app/start.sh /app/start.sh
|
|
|
|
RUN echo '<h1>Hexo Blog - Optimized Version</h1><p> Heredoc implementation</p><p> PUID/PGID support</p><p> Log rotation</p><p> Package optimization</p><p> Enhanced security</p>' > /var/www/html/index.html
|
|
|
|
HEALTHCHECK --interval=30s --timeout=10s CMD curl -f http://localhost/ || exit 1
|
|
|
|
EXPOSE 80
|
|
|
|
CMD ["/app/start.sh"]
|