- Fix Docker path

This commit is contained in:
nwithan8 2023-12-09 01:05:13 -07:00
parent 1b826b24d8
commit f9fdc7f640
3 changed files with 18 additions and 15 deletions

View File

@ -12,8 +12,11 @@ COPY requirements.txt requirements.txt
# Install Python requirements # Install Python requirements
RUN pip3 install --no-cache-dir -r requirements.txt RUN pip3 install --no-cache-dir -r requirements.txt
# Make Docker /config volume for optional config file
VOLUME /config
# Copy config file from build machine to Docker /config folder # Copy config file from build machine to Docker /config folder
COPY config.yaml* / COPY config.yaml* /config/
# Make Docker /logs volume for log file # Make Docker /logs volume for log file
VOLUME /logs VOLUME /logs

View File

@ -94,10 +94,10 @@ docker run -d \
#### Paths and Environment Variables #### Paths and Environment Variables
| Path | Description | | Path | Description |
|---------|-------------------------------------------------------------------| |-----------|-----------------------------------------------------------------------|
| `/` | Path to config files (`config.yaml` should be in this directory) | | `/config` | Path to config directory (`config.yaml` should be in this directory) |
| `/logs` | Path to log files (`Plex Prerolls.log` will be in this directory) | | `/logs` | Path to log directory (`Plex Prerolls.log` will be in this directory) |
| Environment Variable | Description | | Environment Variable | Description |
|----------------------|-------------------------------------------------------------------| |----------------------|-------------------------------------------------------------------|
@ -140,28 +140,28 @@ date_range:
# Each entry requires start_date, end_date, path values # Each entry requires start_date, end_date, path values
- start_date: 2020-01-01 # Jan 1st, 2020 - start_date: 2020-01-01 # Jan 1st, 2020
end_date: 2020-01-02 # Jan 2nd, 2020 end_date: 2020-01-02 # Jan 2nd, 2020
paths: paths:
- /path/to/video.mp4 - /path/to/video.mp4
- /path/to/another/video.mp4 - /path/to/another/video.mp4
weight: 2 # Add these paths to the list twice (make up greater percentage of prerolls - more likely to be selected) weight: 2 # Add these paths to the list twice (make up greater percentage of prerolls - more likely to be selected)
- start_date: xxxx-07-04 # Every year on July 4th - start_date: xxxx-07-04 # Every year on July 4th
end_date: xxxx-07-04 # Every year on July 4th end_date: xxxx-07-04 # Every year on July 4th
paths: paths:
- /path/to/video.mp4 - /path/to/video.mp4
- /path/to/another/video.mp4 - /path/to/another/video.mp4
weight: 1 weight: 1
- name: "My Schedule" # Optional name for logging purposes - name: "My Schedule" # Optional name for logging purposes
start_date: xxxx-xx-02 # Every year on the 2nd of every month start_date: xxxx-xx-02 # Every year on the 2nd of every month
end_date: xxxx-xx-03 # Every year on the 3rd of every month end_date: xxxx-xx-03 # Every year on the 3rd of every month
paths: paths:
- /path/to/video.mp4 - /path/to/video.mp4
- /path/to/another/video.mp4 - /path/to/another/video.mp4
weight: 1 weight: 1
- start_date: xxxx-xx-xx 08:00:00 # Every day at 8am - start_date: xxxx-xx-xx 08:00:00 # Every day at 8am
end_date: xxxx-xx-xx 09:30:00 # Every day at 9:30am end_date: xxxx-xx-xx 09:30:00 # Every day at 9:30am
paths: paths:
- /path/to/video.mp4 - /path/to/video.mp4
- /path/to/another/video.mp4 - /path/to/another/video.mp4
weight: 1 weight: 1
``` ```

View File

@ -21,7 +21,7 @@ echo "Dry run flag: $DRY_RUN_FLAG"
# Schedule cron job with supplied cron schedule # Schedule cron job with supplied cron schedule
echo "Scheduling cron job" echo "Scheduling cron job"
echo "$CRON_SCHEDULE python3 /run.py -c /config.yaml -l /logs $DRY_RUN_FLAG > /proc/1/fd/1 2>/proc/1/fd/2" > /etc/cron.d/schedule_preroll echo "$CRON_SCHEDULE python3 /run.py -c /config/config.yaml -l /logs $DRY_RUN_FLAG > /proc/1/fd/1 2>/proc/1/fd/2" > /etc/cron.d/schedule_preroll
# Give execution rights on the cron job # Give execution rights on the cron job
chmod 0644 /etc/cron.d/schedule_preroll chmod 0644 /etc/cron.d/schedule_preroll