aboutsummaryrefslogtreecommitdiff
blob: a9d4a49729075e400fcdae7ce069be99973b75e1 (plain) (blame)
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
32
33
34
35
36
37
38
39
40
FROM python:3.6.0 as builder

LABEL maintainer=clarkzjw<[email protected]>

RUN pip install virtualenv

COPY requirements.txt /app/requirements.txt

COPY bootstrap.py /app/bootstrap.py

RUN /app/bootstrap.py

ADD . /app

WORKDIR /app

RUN /bin/bash -c "source /app/.venv/bin/activate && make html"


FROM alpine:latest

RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories

RUN apk add --update git openssh-client && rm -rf /var/cache/apk/*

WORKDIR /html

ENV COMMIT_USER="clarkzjw"
ENV COMMIT_EMAIL="[email protected]"

RUN git clone [email protected]:clarkzjw/blog.jinwei.me.git /html && git checkout gh-pages

COPY --from=builder /app/_build/html /html

RUN git add -A && git commit -m "`date`" && git push origin gh-pages


FROM nginx:alpine

COPY --from=builder /app/_build/html /usr/share/nginx/html
Powered by cgit v1.2.3 (git 2.41.0)