# FROM alpine 

# RUN echo -e https://mirrors.ustc.edu.cn/alpine/v3.15/main > /etc/apk/repositories \
#   && cat /etc/apk/repositories \
# # 设置时区为上海
#   && apk add tzdata && cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
#   && echo "Asia/Shanghai" > /etc/timezone \
#   && apk del tzdata \
# # 解决apline 运行编译后的执行文件 not found错误
# # 由于alpine镜像使用的是musl libc而不是gnu libc，/lib64/ 是不存在的。但他们是兼容的，可以创建个软连接
#   && mkdir /lib64 \
#   && ln -s /lib/libc.musl-x86_64.so.1 /lib64/ld-linux-x86-64.so.2 \
FROM hub.afina.studio/afina-studio/alpine
# https://github.com/Docker-Hub-frolvlad/docker-alpine-glibc

RUN echo -e https://mirrors.ustc.edu.cn/alpine/v3.15/main > /etc/apk/repositories \
  && cat /etc/apk/repositories \
# 设置时区为上海
  && apk add tzdata && cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
  && echo "Asia/Shanghai" > /etc/timezone \
  && apk del tzdata \
  && mkdir -p /root/pay

WORKDIR /root/pay

# 配置
ADD ./app.yaml ./app.yaml

# 证书
ADD ./crt ./crt

ADD ./pay-service ./pay-service

EXPOSE 8888

ENTRYPOINT ["./pay-service"]