74 lines
2.0 KiB
YAML
74 lines
2.0 KiB
YAML
version: "3.7"
|
|
|
|
volumes:
|
|
sshkey:
|
|
|
|
networks:
|
|
default:
|
|
ipam:
|
|
config:
|
|
- subnet: 10.10.0.0/24
|
|
|
|
services:
|
|
unit:
|
|
build:
|
|
dockerfile: dockerfile/php.dockerfile
|
|
args:
|
|
IP: ${IP}
|
|
ports:
|
|
- 443:443
|
|
volumes:
|
|
- ./config/unit.json:/docker-entrypoint.d/config.json
|
|
- ./config/php.ini:/usr/local/etc/php/php.ini
|
|
- ./config/.profile:/root/.bashrc:ro
|
|
- ./config/clients.json:/app/clients.json
|
|
- ./app:/app
|
|
- ./logs:/app/logs/
|
|
- type: volume
|
|
target: /ssh
|
|
source: sshkey
|
|
environment:
|
|
TZ: ${TZ}
|
|
ADDRESS: ${ADDRESS}
|
|
PORT_WG: ${PORT}
|
|
hostname: unit
|
|
restart: unless-stopped
|
|
depends_on:
|
|
- wg
|
|
stop_grace_period: 1s
|
|
command: bash -c 'chown -R www-data:www-data /app/logs && chown www-data:www-data /app/clients.json && php init.php && /usr/local/bin/docker-entrypoint.sh unitd --no-daemon'
|
|
working_dir: /app
|
|
proxy:
|
|
build:
|
|
dockerfile: dockerfile/proxy.dockerfile
|
|
volumes:
|
|
- ./config/.profile:/root/.bashrc:ro
|
|
- ./config/sockd.conf:/etc/sockd.conf
|
|
hostname: proxy
|
|
networks:
|
|
default:
|
|
ipv4_address: 10.10.0.3
|
|
environment:
|
|
TZ: ${TZ}
|
|
wg:
|
|
build:
|
|
dockerfile: dockerfile/wireguard.dockerfile
|
|
volumes:
|
|
- ./config/.profile:/root/.bashrc:ro
|
|
- ./config/wg0.conf:/etc/wireguard/wg0.conf
|
|
- ./scripts/start_wg.sh:/start_wg.sh
|
|
- ./scripts/reset_wg.sh:/reset_wg.sh
|
|
- type: volume
|
|
target: /ssh
|
|
source: sshkey
|
|
hostname: wireguard
|
|
ports:
|
|
- ${PORT}:${PORT}/udp
|
|
environment:
|
|
TZ: ${TZ}
|
|
PORT_WG: ${PORT}
|
|
ADDRESS: ${ADDRESS}
|
|
cap_add:
|
|
- NET_ADMIN
|
|
stop_grace_period: 1s
|