-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile-old
executable file
·59 lines (42 loc) · 1.63 KB
/
Dockerfile-old
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# =================== git-builder ==============
FROM alpine/git:latest AS git-builder
LABEL maintainer Claudius Teodorescu <[email protected]>
ARG git_credentials=claudius
ARG data_git_url=ssh://[email protected]:3000/solirom/tdrg-data.git
ARG ssh_pub_key
ARG ssh_prv_key
COPY ./ /angel/
RUN mkdir -p /root/.ssh/ && \
chmod 0700 /root/.ssh && \
ssh-keyscan 188.212.37.221 > /root/.ssh/known_hosts && \
echo "$ssh_pub_key" > /root/.ssh/id_rsa.pub && \
echo "${ssh_prv_key}" > /root/.ssh/id_rsa && \
chmod 600 /root/.ssh/id_rsa && \
chmod 600 /root/.ssh/id_rsa.pub && \
time git clone -b master --depth=1 $data_git_url /home/git/data && \
rm -rf 'home/git/data/.git'
# =================== saxon-builder ==============
FROM klakegg/saxon:he AS saxon-builder
COPY --from=git-builder /home/git/data /git/data
COPY --from=git-builder /angel /angel
RUN cd /git/data && \
for dir in $(ls -d */); \
do \
mkdir -p /angel/static/data/"$dir" && \
time xslt -s:/git/data/"$dir" -xsl:/angel/static/modules/tei-to-html/tei-to-html.xsl -o:/angel/static/data/"$dir"; \
done
# =================== alpine-builder ==============
FROM alpine:latest AS alpine-builder
RUN addgroup -S angel && \
adduser -S angel -G angel
COPY --from=saxon-builder --chown=angel:angel /angel /angel
# =================== scratch-builder ==============
FROM scratch
COPY --from=alpine-builder /etc/passwd /etc/passwd
COPY --from=alpine-builder /etc/group /etc/group
COPY --from=alpine-builder /angel /angel
USER angel:angel
EXPOSE 7777
WORKDIR /angel
ENTRYPOINT ["/angel/tdrg-site"]
# sudo docker run --publish 7001:7777 -a stderr tdrg:latest