mirror of
http://git.nowherejezfoltodf4jiyl6r56jnzintap5vyjlia7fkirfsnfizflqd.onion/nihilist/blog-contributions.git
synced 2025-05-16 06:27:03 +00:00
push to prod (1/2)
This commit is contained in:
parent
ff44033d47
commit
0969c49c48
8 changed files with 975 additions and 1 deletions
28
deploy/docker-compose.yml
Normal file
28
deploy/docker-compose.yml
Normal file
|
@ -0,0 +1,28 @@
|
|||
services:
|
||||
blogmk-puller:
|
||||
image: alpine:latest
|
||||
container_name: blogmk_puller
|
||||
environment:
|
||||
- SITE_URL=http://mkdocsjdd76rvqxrgykpywpsxoij734ycf34767dmfmfqjmqcj7hurad.onion
|
||||
- BRANCH=main
|
||||
- REPO_URL=http://git.nowherejezfoltodf4jiyl6r56jnzintap5vyjlia7fkirfsnfizflqd.onion/nihilist/opsec-blog-v2
|
||||
- REFRESH_SEC=900
|
||||
volumes:
|
||||
- ./repo:/repo
|
||||
- ./servable:/servable
|
||||
- ./entry.sh:/entry.sh:ro
|
||||
extra_hosts:
|
||||
- "host.docker.internal:host-gateway"
|
||||
entrypoint: ["sh", "/entry.sh"]
|
||||
network_mode: "host"
|
||||
restart: unless-stopped
|
||||
|
||||
blogmk-server:
|
||||
image: nginx:alpine
|
||||
container_name: blogmk_server
|
||||
volumes:
|
||||
- ./nginx.conf:/etc/nginx/sites-enabled/default:ro
|
||||
- ./servable:/usr/share/nginx/html:ro
|
||||
ports:
|
||||
- "7080:80"
|
||||
restart: unless-stopped
|
31
deploy/entry.sh
Normal file
31
deploy/entry.sh
Normal file
|
@ -0,0 +1,31 @@
|
|||
#!/bin/sh
|
||||
|
||||
apk add --no-cache git wget mkdocs-material py3-regex py3-requests py3-colorama
|
||||
|
||||
mkdir -p /repo
|
||||
cd /repo
|
||||
#rm -rf -- /repo/..?* /repo/.[!.]* /repo/*
|
||||
|
||||
while true; do
|
||||
echo "$(date): Cloning or updating the repository..."
|
||||
git config --global --add safe.directory /repo
|
||||
git config --global --add http.proxy socks5h://localhost:9050
|
||||
if [ -d "/repo/.git" ]; then
|
||||
git restore .
|
||||
git pull origin "${BRANCH}"
|
||||
else
|
||||
git clone -b "${BRANCH}" "${REPO_URL}" /repo
|
||||
fi;
|
||||
|
||||
sed -i "s/^site_url:.*//g" /repo/mkdocs.yml
|
||||
echo "site_url: ${SITE_URL}" >> /repo/mkdocs.yml
|
||||
|
||||
echo "Building mkdocs site..."
|
||||
# remove old contents
|
||||
rm -rf /servable/*
|
||||
## do necessarry transition related fixes
|
||||
#sh blogfix.sh
|
||||
mkdocs build -d /servable
|
||||
sleep $REFRESH_SEC
|
||||
done
|
||||
|
12
deploy/nginx.conf
Normal file
12
deploy/nginx.conf
Normal file
|
@ -0,0 +1,12 @@
|
|||
server {
|
||||
listen 80;
|
||||
|
||||
gzip on;
|
||||
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
|
||||
|
||||
location / {
|
||||
root /usr/share/nginx/html;
|
||||
index index.html index.htm;
|
||||
}
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue