Compare commits
5 Commits
feat/docke
...
feat/add-p
| Author | SHA1 | Date | |
|---|---|---|---|
| 1eacc3cd8e | |||
| bce403232a | |||
| 37bf43c3ea | |||
| 563ccc5632 | |||
| 8d1ae7e632 |
@@ -96,6 +96,62 @@ services:
|
|||||||
- "303"
|
- "303"
|
||||||
- "26"
|
- "26"
|
||||||
|
|
||||||
|
paperclip-db:
|
||||||
|
image: postgres:17-alpine
|
||||||
|
container_name: paperclip-db
|
||||||
|
restart: always
|
||||||
|
environment:
|
||||||
|
POSTGRES_USER: paperclip
|
||||||
|
POSTGRES_PASSWORD: ${PAPERCLIP_DB_PASSWORD:?PAPERCLIP_DB_PASSWORD must be set}
|
||||||
|
POSTGRES_DB: paperclip
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD-SHELL", "pg_isready -U paperclip -d paperclip"]
|
||||||
|
interval: 5s
|
||||||
|
timeout: 5s
|
||||||
|
retries: 10
|
||||||
|
volumes:
|
||||||
|
- /mnt/HoardingCow_docker_data/Paperclip/pgdata:/var/lib/postgresql/data
|
||||||
|
networks:
|
||||||
|
- ai_backend
|
||||||
|
|
||||||
|
paperclip:
|
||||||
|
image: ghcr.io/paperclipai/paperclip:v2026.517.0
|
||||||
|
container_name: paperclip
|
||||||
|
restart: always
|
||||||
|
ports:
|
||||||
|
- "127.0.0.1:3100:3100"
|
||||||
|
environment:
|
||||||
|
- HOST=0.0.0.0
|
||||||
|
- PORT=3100
|
||||||
|
- SERVE_UI=true
|
||||||
|
- DATABASE_URL=postgres://paperclip:${PAPERCLIP_DB_PASSWORD}@paperclip-db:5432/paperclip
|
||||||
|
- BETTER_AUTH_SECRET=${PAPERCLIP_AUTH_SECRET:?PAPERCLIP_AUTH_SECRET must be set}
|
||||||
|
- PAPERCLIP_PUBLIC_URL=https://paperclip.lazyworkhorse.net
|
||||||
|
- PAPERCLIP_DEPLOYMENT_MODE=authenticated
|
||||||
|
- PAPERCLIP_DEPLOYMENT_EXPOSURE=private
|
||||||
|
volumes:
|
||||||
|
- /mnt/HoardingCow_docker_data/Paperclip/data:/paperclip
|
||||||
|
depends_on:
|
||||||
|
paperclip-db:
|
||||||
|
condition: service_healthy
|
||||||
|
networks:
|
||||||
|
- ai_net
|
||||||
|
- ai_backend
|
||||||
|
labels:
|
||||||
|
- "traefik.enable=true"
|
||||||
|
- "traefik.docker.network=ai_net"
|
||||||
|
|
||||||
|
- "traefik.http.routers.paperclip-http.rule=Host(`paperclip.lazyworkhorse.net`)"
|
||||||
|
- "traefik.http.routers.paperclip-http.entrypoints=web"
|
||||||
|
- "traefik.http.routers.paperclip-http.middlewares=redirect-to-https"
|
||||||
|
|
||||||
|
- "traefik.http.routers.paperclip-https.rule=Host(`paperclip.lazyworkhorse.net`)"
|
||||||
|
- "traefik.http.routers.paperclip-https.entrypoints=websecure"
|
||||||
|
- "traefik.http.routers.paperclip-https.tls=true"
|
||||||
|
- "traefik.http.routers.paperclip-https.tls.certresolver=njalla"
|
||||||
|
|
||||||
|
- "traefik.http.services.paperclip.loadbalancer.server.port=3100"
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
ai_net:
|
ai_net:
|
||||||
external: true
|
external: true
|
||||||
|
|||||||
@@ -78,47 +78,6 @@ PYEOF
|
|||||||
# ---------- Install himalaya-ro wrapper ----------
|
# ---------- Install himalaya-ro wrapper ----------
|
||||||
COPY --chmod=0755 himalaya-ro.sh /usr/local/bin/himalaya-ro
|
COPY --chmod=0755 himalaya-ro.sh /usr/local/bin/himalaya-ro
|
||||||
|
|
||||||
# ---------- Install 7-Zip for CHM extraction ----------
|
|
||||||
RUN /opt/hermes/.venv/bin/python3 /dev/stdin << 'PYEOF'
|
|
||||||
import urllib.request, tarfile, os, shutil, re, subprocess
|
|
||||||
|
|
||||||
# Scrape 7-zip.org for latest Linux x64 binary
|
|
||||||
url = 'https://7-zip.org/download.html'
|
|
||||||
req = urllib.request.Request(url, headers={'User-Agent': 'Mozilla/5.0'})
|
|
||||||
r = urllib.request.urlopen(req, timeout=15)
|
|
||||||
html = r.read().decode()
|
|
||||||
|
|
||||||
links = re.findall(r'href="(a/7z[\d]+-linux-x64\.tar\.xz)"', html)
|
|
||||||
if not links:
|
|
||||||
raise RuntimeError("Could not find 7z download link")
|
|
||||||
|
|
||||||
dl_url = f'https://7-zip.org/{links[0]}'
|
|
||||||
print(f'Downloading 7z from {dl_url}...')
|
|
||||||
req = urllib.request.Request(dl_url, headers={'User-Agent': 'Mozilla/5.0'})
|
|
||||||
r = urllib.request.urlopen(req, timeout=30)
|
|
||||||
data = r.read()
|
|
||||||
|
|
||||||
with open('/tmp/7z.tar.xz', 'wb') as f:
|
|
||||||
f.write(data)
|
|
||||||
|
|
||||||
subprocess.run(['tar', '-xJf', '/tmp/7z.tar.xz', '-C', '/tmp/'], check=True)
|
|
||||||
|
|
||||||
for root, dirs, files in os.walk('/tmp'):
|
|
||||||
for f in files:
|
|
||||||
if f == '7zz':
|
|
||||||
src = os.path.join(root, f)
|
|
||||||
shutil.move(src, '/usr/local/bin/7zz')
|
|
||||||
os.chmod('/usr/local/bin/7zz', 0o755)
|
|
||||||
print(f'7zz installed from {src}')
|
|
||||||
break
|
|
||||||
|
|
||||||
os.remove('/tmp/7z.tar.xz')
|
|
||||||
|
|
||||||
# Verify
|
|
||||||
r = subprocess.run(['/usr/local/bin/7zz'], capture_output=True, text=True)
|
|
||||||
print(f'7-Zip {r.stdout.strip()[:60]}')
|
|
||||||
PYEOF
|
|
||||||
|
|
||||||
|
|
||||||
# ---------- Runtime ----------
|
# ---------- Runtime ----------
|
||||||
USER hermes
|
USER hermes
|
||||||
|
|||||||
@@ -8,13 +8,10 @@ services:
|
|||||||
- USER_GID=1000
|
- USER_GID=1000
|
||||||
- GITEA__server__ROOT_URL=https://code.lazyworkhorse.net
|
- GITEA__server__ROOT_URL=https://code.lazyworkhorse.net
|
||||||
- GITEA__actions__ENABLED=true
|
- GITEA__actions__ENABLED=true
|
||||||
- GITEA__actions__DEFAULT_ACTIONS_URL=off
|
|
||||||
- SSH_PORT=2222
|
- SSH_PORT=2222
|
||||||
- SSH_LISTEN_PORT=2222
|
- SSH_LISTEN_PORT=2222
|
||||||
# Enable Gitea Actions (act_runner required on host)
|
# Enable Gitea Actions (act_runner required on host)
|
||||||
- GITEA__actions__ENABLED=true
|
- GITEA__actions__ENABLED=true
|
||||||
# Don't fetch actions from GitHub (offline mode + local only)
|
|
||||||
- GITEA__actions__DEFAULT_ACTIONS_URL=off
|
|
||||||
volumes:
|
volumes:
|
||||||
- /mnt/HoardingCow_docker_data/Gitea:/data
|
- /mnt/HoardingCow_docker_data/Gitea:/data
|
||||||
networks:
|
networks:
|
||||||
|
|||||||
Reference in New Issue
Block a user