mirror of
https://github.com/woodchen-ink/random-api-go.git
synced 2025-07-18 05:42:01 +08:00
Update the GitHub Actions workflow to include Go setup, multi-arch builds, and push multi-arch Docker images. Also, refactor the CSV service to improve logging and caching mechanism.
24 lines
533 B
Docker
24 lines
533 B
Docker
FROM --platform=$TARGETPLATFORM alpine:latest
|
|
|
|
WORKDIR /root/
|
|
|
|
# 安装必要的包
|
|
RUN apk --no-cache add ca-certificates tzdata tini
|
|
|
|
# 创建日志目录并设置权限
|
|
RUN mkdir -p /var/log/random-api && chmod 755 /var/log/random-api
|
|
|
|
# 根据目标平台复制对应的二进制文件
|
|
ARG TARGETARCH
|
|
COPY bin/${TARGETARCH}/random-api .
|
|
COPY public ./public
|
|
COPY public /tmp/public
|
|
COPY start.sh /start.sh
|
|
RUN chmod +x /start.sh
|
|
|
|
EXPOSE 5003
|
|
|
|
# 使用 tini 作为初始化系统
|
|
ENTRYPOINT ["/sbin/tini", "--"]
|
|
CMD ["/start.sh"]
|