Skip to content

Commit fc9dca0

Browse files
committed
Support for AVR3313 + docker build
1 parent f349a26 commit fc9dca0

File tree

5 files changed

+55
-2
lines changed

5 files changed

+55
-2
lines changed

Dockerfile

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
FROM alpine:3.15
2+
3+
ARG DOCKER_USER=dockerapp
4+
ARG USER_HOME=/home/$DOCKER_USER
5+
ARG DOCKER_GID=5000
6+
ARG YCAST_PORT=8080
7+
8+
EXPOSE $YCAST_PORT
9+
10+
ENV YCAST_PORT=$YCAST_PORT
11+
12+
RUN adduser -h $USER_HOME -s /bin/sh -u $DOCKER_GID -D $DOCKER_USER
13+
14+
RUN apk update \
15+
&& apk add python3 py3-setuptools dumb-init \
16+
&& apk add --virtual build-tools gcc python3-dev libpq-dev musl-dev \
17+
&& apk add jpeg-dev zlib-dev
18+
19+
ARG SRC_HOME=/usr/local/src
20+
ARG YCAST_SRC=$SRC_HOME/ycast
21+
RUN mkdir -p $YCAST_SRC
22+
23+
COPY ycast/* $YCAST_SRC/
24+
COPY setup.py README.md $SRC_HOME/
25+
COPY examples/stations.yml.example /etc/stations.yml
26+
27+
RUN cd $SRC_HOME && python3 $SRC_HOME/setup.py build && python3 $SRC_HOME/setup.py install
28+
29+
RUN apk del build-tools
30+
31+
COPY docker/entrypoint.sh /usr/local/bin/
32+
33+
WORKDIR $USER_HOME
34+
USER $DOCKER_USER
35+
36+
CMD [ "/usr/local/bin/entrypoint.sh"]

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ Any reported device helps the community to see which AVRs work properly and whic
3131

3232
* Denon AVR-X_000 series (AVR-X1000, AVR-2000, AVR-X3000, AVR-X4000)
3333
* Denon AVR-1912
34+
* Denon AVR-3313
3435
* Denon AVR-X2200W
3536
* Denon CEOL piccolo N5
3637
* Denon CEOL N9

docker-compose.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
version: '2.2'
2+
services:
3+
ycast:
4+
build:
5+
context: .
6+
dockerfile: Dockerfile
7+
image:
8+
ycast
9+
ports:
10+
- "8080:8080"
11+
mem_limit: 32M

docker/entrypoint.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/usr/bin/dumb-init /bin/sh
2+
3+
SCRIPT_DIR=$(dirname $(readlink -f $0))
4+
cd $SCRIPT_DIR
5+
6+
python3 -m ycast -p $YCAST_PORT -c /etc/stations.yml -d

ycast/server.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ def vtuner_redirect(url):
121121
@app.route('/setupapp/<path:path>',
122122
methods=['GET', 'POST'])
123123
def upstream(path):
124-
if request.args.get('token') == '0':
124+
if request.args.get('token') == '0' or 'SignIn.asp' in path:
125125
return vtuner.get_init_token()
126126
if request.args.get('search'):
127127
return station_search()
@@ -154,7 +154,6 @@ def landing(path=''):
154154
page.set_count(1)
155155
return page.to_string()
156156

157-
158157
@app.route('/' + PATH_ROOT + '/' + PATH_MY_STATIONS + '/',
159158
methods=['GET', 'POST'])
160159
def my_stations_landing():

0 commit comments

Comments
 (0)