Skip to content

Commit f1f16c0

Browse files
authored
Merge pull request #9 from NiNiyas/alpha
2 parents 60ab69a + dd6ad78 commit f1f16c0

37 files changed

+1327
-1176
lines changed

.dockerignore

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ __pycache__/
1717
*.log*
1818

1919
# databases
20-
/*.db
20+
*.db
2121

2222
# configs
2323
*.cfg
24-
/config/config.json
24+
src/config/config.json
2525

2626
# generators
2727
*.bat

.github/workflows/ghcr-publish.yml

+8-12
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
name: Build and Push to GHCR
22

33
on:
4-
workflow_dispatch:
5-
repository_dispatch:
6-
types: [Build and Push to GHCR]
4+
workflow_dispatch: ~
75
push:
86
branches:
97
- master
@@ -13,32 +11,32 @@ jobs:
1311
runs-on: ubuntu-latest
1412
steps:
1513
- name: Get Short SHA
16-
uses: benjlevesque/short-sha@v2.2
14+
uses: benjlevesque/short-sha@v3.0
1715
id: short-sha
1816
with:
1917
length: 7
2018

2119
- name: Checkout
22-
uses: actions/checkout@v4.1.1
20+
uses: actions/checkout@v4.1.7
2321

2422
- name: Log into GHCR
2523
run: echo "${{ secrets.GIT_TOKEN }}" | docker login https://ghcr.io -u ${{ github.actor }} --password-stdin
2624

2725
- name: Set up QEMU
28-
uses: docker/setup-qemu-action@v3.0.0
26+
uses: docker/setup-qemu-action@v3.1.0
2927
with:
3028
image: tonistiigi/binfmt:latest
3129
platforms: all
3230

3331
- name: Set up Docker Buildx
34-
uses: docker/setup-buildx-action@v3.0.0
32+
uses: docker/setup-buildx-action@v3.4.0
3533
with:
3634
install: true
3735
version: latest
3836
driver-opts: image=moby/buildkit:master
3937

4038
- name: Build and push amd64
41-
uses: docker/build-push-action@v5.1.0
39+
uses: docker/build-push-action@v6.3.0
4240
with:
4341
context: ./
4442
file: ./Dockerfile
@@ -49,11 +47,10 @@ jobs:
4947
ghcr.io/${{ secrets.GIT_USER }}/autoscan:amd64_commit-${{ steps.short-sha.outputs.sha }}
5048
platforms: linux/amd64
5149
build-args: |
52-
OVERLAY_ARCH=amd64
53-
ARCH=amd64
50+
OVERLAY_ARCH=x86_64
5451
5552
- name: Build and push aarch64
56-
uses: docker/build-push-action@v5.1.0
53+
uses: docker/build-push-action@v6.3.0
5754
with:
5855
context: ./
5956
file: ./Dockerfile
@@ -65,7 +62,6 @@ jobs:
6562
platforms: linux/arm64
6663
build-args: |
6764
OVERLAY_ARCH=aarch64
68-
ARCH=arm64
6965
7066
- name: Create and push manifest images
7167
uses: Noelware/docker-manifest-action@master

.gitignore

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ __pycache__/
1717
*.log*
1818

1919
# databases
20-
/*.db
20+
*.db
2121

2222
# configs
2323
*.cfg
24-
/config/config.json
24+
src/config/config.json
2525

2626
# generators
2727
*.bat

.pre-commit-config.yaml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
default_language_version:
2+
python: python3.12
3+
4+
repos:
5+
- repo: https://github.com/psf/black-pre-commit-mirror
6+
rev: 24.4.2
7+
hooks:
8+
- id: black
9+
language_version: python3.12
10+
description: "Black: The uncompromising Python code formatter"
11+
entry: black
12+
language: python

Dockerfile

+15-26
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,38 @@
11
FROM alpine:latest
22

3-
ARG ARCH
43
ARG OVERLAY_ARCH
5-
ARG RCLONE_VERSION=1.65.0
6-
ARG OVERLAY_VERSION=v2.2.0.3
4+
ARG OVERLAY_VERSION=3.2.0.0
75

8-
WORKDIR /opt/autoscan
6+
WORKDIR /usr/src/app
7+
8+
COPY . .
99

1010
ENV CONFIG_DIR="/config" \
1111
PUID="1000" \
1212
PGID="1000" \
1313
UMASK="002" \
1414
S6_BEHAVIOUR_IF_STAGE2_FAILS=2 \
1515
PYTHONUNBUFFERED=1 \
16-
PATH=/opt/plex_autoscan:${PATH} \
1716
TZ=Europe/Brussels \
1817
AUTOSCAN_CONFIG=/config/config.json \
1918
AUTOSCAN_LOGFILE=/config/autoscan.log \
2019
AUTOSCAN_LOGLEVEL=INFO \
2120
AUTOSCAN_QUEUEFILE=/config/queue.db \
22-
AUTOSCAN_CACHEFILE=/config/cache.db
21+
AUTOSCAN_CACHEFILE=/config/cache.db \
22+
AUTOSCAN_COMMAND=server
2323

24-
ARG RCLONE_URL="https://github.com/rclone/rclone/releases/download/v${RCLONE_VERSION}/rclone-v${RCLONE_VERSION}-linux-${ARCH}.zip"
25-
ARG S6_URL="https://github.com/just-containers/s6-overlay/releases/download/${OVERLAY_VERSION}/s6-overlay-${OVERLAY_ARCH}-installer"
24+
RUN apk update && apk add --no-cache python3 py3-pip shadow bash docker-cli findutils inotify-tools && \
25+
apk add --no-cache --virtual=build-deps gcc linux-headers musl-dev python3-dev curl wget xz unzip git
2626

27-
RUN wget -q -O rclone.zip $RCLONE_URL && \
28-
unzip rclone.zip && \
29-
mv rclone-*/rclone /bin/rclone && \
30-
chmod +x /bin/rclone && \
31-
rm -rf rclone.zip rclone-*
27+
RUN curl https://rclone.org/install.sh | bash
3228

33-
RUN wget -q $S6_URL -O /tmp/s6-overlay-${OVERLAY_ARCH}-installer && \
34-
chmod +x /tmp/s6-overlay-${OVERLAY_ARCH}-installer && \
35-
/tmp/s6-overlay-${OVERLAY_ARCH}-installer / && \
36-
rm /tmp/s6-overlay-${OVERLAY_ARCH}-installer
37-
38-
COPY . .
29+
RUN curl -fsSL https://github.com/just-containers/s6-overlay/releases/download/v${OVERLAY_VERSION}/s6-overlay-noarch.tar.xz | tar Jpxf - -C / && \
30+
curl -fsSL https://github.com/just-containers/s6-overlay/releases/download/v${OVERLAY_VERSION}/s6-overlay-${OVERLAY_ARCH}.tar.xz | tar Jpxf - -C / && \
31+
curl -fsSL https://github.com/just-containers/s6-overlay/releases/download/v${OVERLAY_VERSION}/s6-overlay-symlinks-noarch.tar.xz | tar Jpxf - -C / && \
32+
curl -fsSL https://github.com/just-containers/s6-overlay/releases/download/v${OVERLAY_VERSION}/s6-overlay-symlinks-arch.tar.xz | tar Jpxf - -C /
3933

40-
RUN apk add --no-cache --upgrade python3 git py3-pip py3-setuptools shadow bash docker-cli && \
41-
apk --no-cache --virtual=build-deps add gcc linux-headers musl-dev python3-dev && \
42-
pip install -U --no-cache-dir pip idna wheel --break-system-packages && \
43-
pip install -U --no-cache-dir pip -r requirements.txt --break-system-packages && \
44-
apk --purge del build-deps && \
45-
ln -s /opt/plex_autoscan/config /config
34+
RUN pip install --no-cache-dir -r requirements.txt --break-system-packages && \
35+
apk --purge del build-deps
4636

4737
COPY /root /
4838

@@ -58,5 +48,4 @@ VOLUME ["/config", "/plexDb"]
5848

5949
EXPOSE 3468/tcp
6050

61-
CMD ["python3", "scan.py" , "server"]
6251
ENTRYPOINT ["/init"]

0 commit comments

Comments
 (0)