# 基础镜像
FROM openjdk:8

# 维护人
LABEL maintainer="zxm<2060197959@qq.com>"

# 创建目录
RUN mkdir -p /home/app

# 使用阿里云镜像源并安装 LibreOffice
RUN sed -i 's/deb.debian.org/mirrors.aliyun.com/g' /etc/apt/sources.list && \
    sed -i 's/security.debian.org/mirrors.aliyun.com/g' /etc/apt/sources.list && \
    apt-get update && \
    apt-get install -y --no-install-recommends \
        libreoffice \
        libreoffice-writer \
        fonts-liberation \
        fonts-dejavu && \
    apt-get clean && \
    rm -rf /var/lib/apt/lists/*

# 拷贝项目jar
COPY target/yd-oss-api-1.0-SNAPSHOT-exec.jar /home/app/yd-oss-api.jar

# 执行命令启动jar
ENTRYPOINT ["java", "-jar", "/home/app/yd-oss-api.jar"]

# 暴露端口
EXPOSE 9106