Skip to content

Commit

Permalink
feat(plex): add macvlan configuration to plex and add examples
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanbeldad committed Jun 17, 2018
1 parent e3489d4 commit 6a1b3db
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 6 deletions.
47 changes: 42 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,30 @@
# Media Server

## Usage
Run a set of containers in one step. Included plex server, sonarr, radarr,
jackett, transmission, ddclient and nginx.

## Requirements

- Your preferred flavour of linux
- Golang
- Docker CE
- Git?
- A cup of coffee

## Motivation

Create and manage **independent** media centers scoped by user.

## Where to start

Simply clone this repository and execute the mediaserver script
```
git clone https://github.com/ivandelabeldad/media-server.git
cd media-server
sudo go run mediaserver start awesome 42 /storage
```

### Help

```
Start o stop the desired user media server
Expand All @@ -20,11 +44,24 @@ Example:
Storage:
/media/ivandelabeldad
Ports:
Plex 4200
Plex 4200
Tranmission 4201
Sonarr 4202
Radarr 4203
Jackett 4204
Sonarr 4202
Radarr 4203
Jackett 4204
```

## Important

Plex doesn't work well inside a bridge network, so in order to use it and prevent
potential problems a host or macvlan network is recommended.

Due to the impossibility of create multiple plex instances using the host network, the
obviuous option is macvlan.

A basic example (mostly home networks could use it using 192.168.X.0/24)
```
docker network create -v macvlan --gateway=192.168.1.1 --subnet=192.168.1.0/24 -o parent=eth0 --ip-range=192.168.1.16/28 macvlan
```

## License
Expand Down
4 changes: 4 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ version: '3'
services:
plex:
image: plexinc/pms-docker
hostname: plex-${MEDIA_USERNAME}
networks:
- bridge
- macvlan
environment:
- PLEX_UID=${MEDIA_UID}
- PLEX_GID=${MEDIA_GID}
Expand Down Expand Up @@ -106,3 +108,5 @@ services:
networks:
bridge:
driver: bridge
macvlan:
external: true
6 changes: 5 additions & 1 deletion nginx/docker/default.conf
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
upstream plex-upstream {
server plex:32400;
}

server {
listen 32400;
location / {
proxy_pass "http://plex:32400";
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_redirect off;
proxy_buffering off;
proxy_pass http://plex-upstream;
}
}

Expand Down

0 comments on commit 6a1b3db

Please sign in to comment.