-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
27 lines (20 loc) · 772 Bytes
/
Dockerfile
File metadata and controls
27 lines (20 loc) · 772 Bytes
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
FROM node:16.19.1
WORKDIR /data/git
ADD id_rsa_2048 /root/.ssh/
RUN chmod 600 /root/.ssh/id_rsa_2048
ADD . ./
# 生成网页
RUN npm install && npm run build
# 上传到GIT
RUN install -dv /data/page/ && cp -a public /data/page/
ARG GITHUB
ARG GUSER
ARG EMAIL
WORKDIR /data/page/public/
ENV GIT_SSH_COMMAND='ssh -i /root/.ssh/id_rsa_2048 -o IdentitiesOnly=yes -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no'
RUN git config --global init.defaultBranch main && git config --global user.email $EMAIL && git config --global user.name $GUSER && \
git config --global pull.rebase true && \
git init && \
git remote add origin $GITHUB && git add -A && git commit -m init && \
git branch -M main && \
git push --force origin main