Files
schoolNews/docker/Dockerfile.base-web
2025-11-24 13:36:03 +08:00

42 lines
943 B
Docker
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# ====================================
# 前端基础镜像 - Base Web
# 包含Nginx + 基础配置
# 用途:作为前端服务镜像的基础
# ====================================
FROM nginx:alpine
# 设置环境变量
ENV TZ=Asia/Shanghai
# 安装必要工具
RUN apk add --no-cache \
# 时区数据
tzdata \
# 基础工具
bash \
curl \
# 日志处理
&& mkdir -p /app/logs
# 设置时区
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \
echo "Asia/Shanghai" > /etc/timezone
# 创建应用目录
WORKDIR /app
RUN mkdir -p /app/config /app/logs
# Nginx基础配置可被覆盖
RUN rm -f /etc/nginx/conf.d/default.conf
# 镜像元数据
LABEL maintainer="School News Team" \
description="Base image for school-news frontend service with Nginx" \
version="1.0"
# 暴露端口
EXPOSE 80
# 默认命令(会被子镜像覆盖)
CMD ["nginx", "-g", "daemon off;"]