forked from tangly1024/NotionNext
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile-update
31 lines (25 loc) · 1.17 KB
/
Dockerfile-update
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# 使用 Node.js 官方镜像作为基础镜像
FROM node:20-alpine3.19 AS build
# # 设置镜像源,安装依赖软件、设置时区,并安装应用依赖 (测试)
# RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories && \
# apk --update --no-cache add git tzdata libc6-compat && \
# cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \
# echo "Asia/Shanghai" > /etc/timezone && \
# npm config set registry https://registry.npmmirror.com -g && \
# git clone -b my-branch https://github.com/zscmmm/NotionNext.git /app/NotionNext && \
# cd /app/NotionNext && rm -rf .git && yarn install --frozen-lockfile && \
# yarn build
WORKDIR /app/NotionNext
COPY . .
RUN apk add --no-cache curl tzdata bash libc6-compat git && yarn install --frozen-lockfile && yarn build
# 添加定时任务文件
COPY cronjob /etc/cron.d/cronjob
# 添加脚本文件
COPY update_and_restart.sh /usr/local/bin/update_and_restart.sh
# 给脚本文件添加执行权限
RUN chmod +x /usr/local/bin/update_and_restart.sh \
&& crontab /etc/cron.d/cronjob
# 设置容器的启动命令
CMD ["yarn", "start"]
# 暴露应用程序运行的端口
EXPOSE 3000