|
@@ -0,0 +1,32 @@
|
|
|
|
+- name: onion service container
|
|
|
|
+ docker_container:
|
|
|
|
+ name: '{{ onion_service_container_name }}'
|
|
|
|
+ image: '{{ onion_service_container_image }}'
|
|
|
|
+ env:
|
|
|
|
+ VIRTUAL_PORT: '{{ onion_service_virtual_port | string }}'
|
|
|
|
+ TARGET: '{{ onion_service_target }}'
|
|
|
|
+ NON_ANONYMOUS_SINGLE_HOP_MODE: "{{ onion_service_non_anonymous_single_hop_mode | string }}"
|
|
|
|
+ read_only: yes
|
|
|
|
+ mounts:
|
|
|
|
+ - type: volume
|
|
|
|
+ source: '{{ onion_service_container_name }}_data'
|
|
|
|
+ target: /var/lib/tor
|
|
|
|
+ read_only: false
|
|
|
|
+ - type: volume
|
|
|
|
+ source: '{{ onion_service_container_name }}_key'
|
|
|
|
+ target: /onion-service
|
|
|
|
+ read_only: false
|
|
|
|
+ - type: tmpfs
|
|
|
|
+ target: /tmp # torrc
|
|
|
|
+ # nosuid,nodev,noexec added by default
|
|
|
|
+ tmpfs_mode: '1777'
|
|
|
|
+ tmpfs_size: 4k
|
|
|
|
+ networks: [name: '{{ onion_service_network_name }}']
|
|
|
|
+ purge_networks: yes
|
|
|
|
+ cap_drop: [ALL]
|
|
|
|
+ security_opts: [no-new-privileges]
|
|
|
|
+ cpu_quota: 8000
|
|
|
|
+ cpu_period: 10000
|
|
|
|
+ memory: 128M
|
|
|
|
+ restart_policy: unless-stopped
|
|
|
|
+ state: started
|