48 lines
1.2 KiB
YAML
48 lines
1.2 KiB
YAML
---
|
|
services:
|
|
app:
|
|
image: containers.torproject.org/tpo/onion-services/onimages/tor:alpine
|
|
volumes:
|
|
- "tor:/var/lib/tor"
|
|
networks:
|
|
- proxy
|
|
deploy:
|
|
restart_policy:
|
|
condition: on-failure
|
|
labels:
|
|
- "traefik.enable=false"
|
|
- "coop-cloud.${STACK_NAME}.version=1.0.1+alpine"
|
|
- "backupbot.backup=${ENABLE_BACKUPS}"
|
|
- "backupbot.backup.volumes.tor.path=traefik"
|
|
configs:
|
|
- source: torrc_config
|
|
target: /etc/tor/torrc
|
|
mode: 0644
|
|
command:
|
|
- "-f"
|
|
- "/etc/tor/torrc"
|
|
# Connects to Tor conrol port using cookie authentication and verifies bootstrapping completed
|
|
healthcheck:
|
|
test: test -n "$$(
|
|
printf '%s\n%s\n%s\n'
|
|
"AUTHENTICATE $$(xxd -p -c 32 /var/lib/tor/.tor/control_auth_cookie | tr -d "\n")"
|
|
"GETINFO status/bootstrap-phase"
|
|
"QUIT" |
|
|
nc 127.0.0.1 9051 |
|
|
grep "PROGRESS=100")"
|
|
interval: 30s
|
|
timeout: 10s
|
|
|
|
configs:
|
|
torrc_config:
|
|
name: ${STACK_NAME}_torrc_config_${TORRC_CONFIG_VERSION}
|
|
file: torrc.tmpl
|
|
template_driver: golang
|
|
|
|
networks:
|
|
proxy:
|
|
external: true
|
|
|
|
volumes:
|
|
tor:
|