forked from Kurrawong/bgs-prez-ui-theme
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
61 lines (41 loc) · 1.63 KB
/
Dockerfile
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
60
61
ARG PREZ_UI_HOME=/prez-ui
ARG PREZ_UI_VERSION=3.8.2
FROM docker.io/node:18-alpine3.16 AS builder
RUN apk update && \
apk add \
bash \
git
WORKDIR /
ARG PREZ_UI_HOME
ENV PREZ_UI_HOME=${PREZ_UI_HOME}
ARG PREZ_UI_VERSION
ENV PREZ_UI_VERSION=${PREZ_UI_VERSION}
RUN wget -O prez-ui.zip https://github.com/RDFLib/prez-ui/releases/download/v${PREZ_UI_VERSION}/prez-ui-${PREZ_UI_VERSION}.zip \
&& unzip prez-ui.zip
WORKDIR ${PREZ_UI_HOME}
COPY public/ ${PREZ_UI_HOME}/public
# Strip out Prez UI header and footer placeholders.
RUN sed -i 's+<header id="header"></header>+<div id="header"></div>+g' ${PREZ_UI_HOME}/index.html
RUN sed -i 's+<footer id="footer"></footer>+<div id="footer"></div>+g' ${PREZ_UI_HOME}/index.html
# # Add custom header and footer.
RUN mv ${PREZ_UI_HOME}/src/App.vue ${PREZ_UI_HOME}/src/PrezApp.vue
COPY custom-vues/App.vue ${PREZ_UI_HOME}/src/App.vue
# Add custom VocPrez page.
COPY custom-vues/views/VocPrezHomeView.vue ${PREZ_UI_HOME}/src/views/vocprez/VocPrezHomeView.vue
COPY custom-vues/views/AboutView.vue ${PREZ_UI_HOME}/src/views/AboutView.vue
COPY custom-vues/views/HomeView.vue ${PREZ_UI_HOME}/src/views/HomeView.vue
COPY custom-vues/util/sparqlExamples.ts ${PREZ_UI_HOME}/src/util/sparqlExamples.ts
RUN rm .env
RUN npm ci && npm run build
# ---
FROM docker.io/nginx:1.23-alpine
ARG PREZ_UI_HOME
ENV PREZ_UI_HOME=${PREZ_UI_HOME}
RUN apk add --no-cache bash
RUN mkdir /app
COPY ./docker_entrypoint.sh ./.env ./
COPY --from=builder ${PREZ_UI_HOME}/dist /app
COPY ./nginx.conf /etc/nginx/nginx.conf
RUN chmod +x /docker_entrypoint.sh
EXPOSE 8000
ENTRYPOINT [ "/bin/bash", "./docker_entrypoint.sh" ]