Skip to content

Instantly share code, notes, and snippets.

@Decicus
Last active October 12, 2023 19:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Decicus/5e2de0ef5cb743e1b97b61ece5631216 to your computer and use it in GitHub Desktop.
Save Decicus/5e2de0ef5cb743e1b97b61ece5631216 to your computer and use it in GitHub Desktop.
version: '3'
services:
vpn:
container_name: wireguard
image: jordanpotter/wireguard
cap_add:
- NET_ADMIN
- SYS_MODULE
sysctls:
net.ipv4.conf.all.src_valid_mark: 1
net.ipv6.conf.all.disable_ipv6: 0
volumes:
# Your WireGuard configuration file. Can be from any provider that allows you to generate WireGuard configurations for connections (e.g. Mullvad, AirVPN).
# Heck, you can even set up a cheap VPS elsewhere and run Nyr's WireGuard install script on it: https://github.com/Nyr/wireguard-install
# The VPN service does *not* need to support port forwarding.
- ./wireguard_vpn.conf:/etc/wireguard/vpn.conf
ports:
# Expose the Plex port locally, so the host can reverse proxy it.
# In my case I have NGINX installed directly on the host and not in a container by itself.
# If you run NGINX Proxy Manager or similar, you might have to mess with Docker networking.
- "127.0.0.1:32400:32400"
restart: unless-stopped
plex:
image: plexinc/pms-docker:latest
container_name: plex
depends_on:
- vpn
# The important line, makes all network traffic for the Plex container go through the VPN container.
network_mode: "service:vpn"
environment:
# Uncomment and set these variables as necessary. You may have to check with `id plex`, if migrating from a regular installation to Docker
# - PUID=112
# - PLEX_UID=112
# - PGID=116
# - PLEX_GID=116
- VERSION=docker
# Leaving this here for documentation, but the `ports` will not work here. See the `vpn` container configuration
# ports:
# - "127.0.0.1:32400:32400"
volumes:
# `./config` is the equivalent of: /var/lib/plexmediaserver
# So once again, if you're migrating from a regular installation on Linux (e.g. via apt), you may want to change this to:
# - /var/lib/plexmediaserver:/config
- ./config:/config
#- /data/PlexMedia:/data/PlexMedia
#- /data/NotPorn:/data/NotPorn
restart: unless-stopped
# Intel iGPU transcoding: https://wiki.alex.lol/books/justsysadminthings/page/hetzner---using-igpu-for-hardware-acceleration
# devices:
# - /dev/dri:/dev/dri
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment