Compare commits
No commits in common. "3b83c3c61668f0044d065a360942cf9358a40d78" and "0efeb5a25ffd4791c29d52df6bb5326f16d6b06a" have entirely different histories.
3b83c3c616
...
0efeb5a25f
5 changed files with 10 additions and 26 deletions
|
@ -17,14 +17,12 @@ COPY default.conf.template /etc/nginx/templates/default.conf.template
|
||||||
WORKDIR /usr/share/nginx/html
|
WORKDIR /usr/share/nginx/html
|
||||||
|
|
||||||
RUN apk --no-cache add nodejs npm bash dumb-init git && \
|
RUN apk --no-cache add nodejs npm bash dumb-init git && \
|
||||||
rm -rf /var/cache/apk/* && \
|
rm -rf /var/cache/apk/*
|
||||||
echo "*/5 * * * * cd /usr/share/nginx/html/content && git pull >/dev/null 2>&1 && cd /usr/share/nginx/html && npx quartz build >/dev/null 2>&1" > /etc/crontabs/root
|
|
||||||
|
|
||||||
RUN ln -s /usr/share/nginx/html/content / && \
|
RUN ln -s /usr/share/nginx/html/content / && \
|
||||||
chown -R nginx:nginx /usr/share/nginx/html && \
|
chown -R nginx:nginx /usr/share/nginx/html && \
|
||||||
chown -R nginx:nginx /usr/share/nginx/html/content
|
chown -R nginx:nginx /usr/share/nginx/html/content
|
||||||
|
|
||||||
ENV BUILD_SCHEDULE="*/5 * * * *"
|
|
||||||
ENV NGINX_PORT=80
|
ENV NGINX_PORT=80
|
||||||
ENV BASE_URL="quartz.zhao.xyz"
|
ENV BASE_URL="quartz.zhao.xyz"
|
||||||
ENV PAGE_TITLE="Quartz Docker"
|
ENV PAGE_TITLE="Quartz Docker"
|
||||||
|
|
2
Makefile
2
Makefile
|
@ -13,7 +13,7 @@ run:
|
||||||
docker compose up
|
docker compose up
|
||||||
|
|
||||||
.PHONY: exec
|
.PHONY: exec
|
||||||
exec:
|
run:
|
||||||
docker exec -it quartz-docker bash
|
docker exec -it quartz-docker bash
|
||||||
|
|
||||||
.PHONY: push
|
.PHONY: push
|
||||||
|
|
12
README.md
12
README.md
|
@ -1,6 +1,8 @@
|
||||||
# quartz-docker
|
## Development
|
||||||
|
|
||||||
Just a docker image for easy deployment of quartz,
|
```bash
|
||||||
|
# Build a development image
|
||||||
[quartz Github](https://github.com/jackyzha0/quartz)
|
make build
|
||||||
[quartz docs](https://quartz.jzhao.xyz/)
|
# Build a specific version
|
||||||
|
make build TAG=v4.4.0
|
||||||
|
```
|
||||||
|
|
|
@ -1,13 +1,11 @@
|
||||||
services:
|
services:
|
||||||
quartz-docker:
|
quartz-docker:
|
||||||
container_name: quartz-docker
|
container_name: quartz-docker
|
||||||
image: code.modernleft.org/gravityfargo/quartz-docker:dev
|
image: quartz-docker:dev
|
||||||
ports:
|
ports:
|
||||||
- 80:8080
|
- 80:8080
|
||||||
environment:
|
environment:
|
||||||
NGINX_PORT: 8080
|
NGINX_PORT: 8080
|
||||||
ENABLE_CRON: "false"
|
|
||||||
BUILD_SCHEDULE: "*/10 * * * *"
|
|
||||||
PAGE_TITLE: "Quartz Docker"
|
PAGE_TITLE: "Quartz Docker"
|
||||||
ENABLE_SPA: "true"
|
ENABLE_SPA: "true"
|
||||||
ENABLE_POPOVERS: "true"
|
ENABLE_POPOVERS: "true"
|
||||||
|
@ -39,8 +37,3 @@ services:
|
||||||
DARKMODE_HIGHLIGHT: "rgba(143,159,169,0.15)"
|
DARKMODE_HIGHLIGHT: "rgba(143,159,169,0.15)"
|
||||||
volumes:
|
volumes:
|
||||||
- /home/nathan/Repositories/modernleft-docs:/content
|
- /home/nathan/Repositories/modernleft-docs:/content
|
||||||
- quartz-deps:/usr/share/nginx/html/node_modules
|
|
||||||
|
|
||||||
volumes:
|
|
||||||
quartz-deps:
|
|
||||||
driver: local
|
|
||||||
|
|
|
@ -18,7 +18,6 @@ replace_text() {
|
||||||
# Modify a temporary file instead of the original
|
# Modify a temporary file instead of the original
|
||||||
sed -e "s|${search}|${replace}|g" "$CONFIG_FILE" >"$TEMP_FILE" && mv "$TEMP_FILE" "$CONFIG_FILE"
|
sed -e "s|${search}|${replace}|g" "$CONFIG_FILE" >"$TEMP_FILE" && mv "$TEMP_FILE" "$CONFIG_FILE"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Quartz Config
|
# Quartz Config
|
||||||
replace_text 'pageTitle: "🪴 Quartz 4.0",' "pageTitle: \"${PAGE_TITLE}\","
|
replace_text 'pageTitle: "🪴 Quartz 4.0",' "pageTitle: \"${PAGE_TITLE}\","
|
||||||
replace_text 'enableSPA: true,' "enableSPA: ${ENABLE_SPA},"
|
replace_text 'enableSPA: true,' "enableSPA: ${ENABLE_SPA},"
|
||||||
|
@ -47,17 +46,9 @@ replace_text 'tertiary: "#84a59d",' "tertiary: \"${DARKMODE_TERTIARY}\","
|
||||||
replace_text 'highlight: "rgba(143, 159, 169, 0.15)",' "highlight: \"${DARKMODE_HIGHLIGHT}\","
|
replace_text 'highlight: "rgba(143, 159, 169, 0.15)",' "highlight: \"${DARKMODE_HIGHLIGHT}\","
|
||||||
chown nginx:nginx "$CONFIG_FILE"
|
chown nginx:nginx "$CONFIG_FILE"
|
||||||
|
|
||||||
echo "${BUILD_SCHEDULE} cd /usr/share/nginx/html/content && git pull >/dev/null 2>&1 && cd /usr/share/nginx/html && npx quartz build >/dev/null 2>&1" >/etc/crontabs/root
|
|
||||||
|
|
||||||
# NGINX script to sub variables in the template
|
# NGINX script to sub variables in the template
|
||||||
/docker-entrypoint.d/20-envsubst-on-templates.sh
|
/docker-entrypoint.d/20-envsubst-on-templates.sh
|
||||||
|
|
||||||
# ENABLE_CRON
|
|
||||||
if [[ "$ENABLE_CRON" == "true" ]]; then
|
|
||||||
echo "Cron is enabled"
|
|
||||||
crond -b
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Starting Quartz..."
|
echo "Starting Quartz..."
|
||||||
echo "Installing dependencies..."
|
echo "Installing dependencies..."
|
||||||
npm i >/dev/null
|
npm i >/dev/null
|
||||||
|
|
Loading…
Reference in a new issue