Skip to content

Commit

Permalink
Support for AVR3313 + docker build
Browse files Browse the repository at this point in the history
  • Loading branch information
heliloop committed Jan 31, 2022
1 parent f349a26 commit be675d6
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 2 deletions.
36 changes: 36 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
FROM alpine:3.15

ARG DOCKER_USER=dockerapp
ARG USER_HOME=/home/$DOCKER_USER
ARG DOCKER_GID=5000
ARG YCAST_PORT=8010

EXPOSE $YCAST_PORT

ENV YCAST_PORT=$YCAST_PORT

RUN adduser -h $USER_HOME -s /bin/sh -u $DOCKER_GID -D $DOCKER_USER

RUN apk update \
&& apk add python3 py3-setuptools dumb-init \
&& apk add --virtual build-tools gcc python3-dev libpq-dev musl-dev \
&& apk add jpeg-dev zlib-dev

ARG SRC_HOME=/usr/local/src
ARG YCAST_SRC=$SRC_HOME/ycast
RUN mkdir -p $YCAST_SRC

COPY ycast/* $YCAST_SRC/
COPY setup.py README.md $SRC_HOME/
COPY examples/stations.yml.example /etc/stations.yml

RUN cd $SRC_HOME && python3 $SRC_HOME/setup.py build && python3 $SRC_HOME/setup.py install

RUN apk del build-tools

COPY docker/entrypoint.sh /usr/local/bin/

WORKDIR $USER_HOME
USER $DOCKER_USER

ENTRYPOINT [ "/usr/local/bin/entrypoint.sh"]
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ Any reported device helps the community to see which AVRs work properly and whic

* Denon AVR-X_000 series (AVR-X1000, AVR-2000, AVR-X3000, AVR-X4000)
* Denon AVR-1912
* Denon AVR-3313
* Denon AVR-X2200W
* Denon CEOL piccolo N5
* Denon CEOL N9
Expand Down
11 changes: 11 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: '2.2'
services:
ycast:
build:
context: .
dockerfile: Dockerfile
image:
af/ycast
ports:
- "8080:8010"
mem_limit: 64M
9 changes: 9 additions & 0 deletions docker/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/dumb-init /bin/sh

SCRIPT_DIR=$(dirname $(readlink -f $0))
cd $SCRIPT_DIR

CMD="python3 -m ycast -p $YCAST_PORT -c /etc/stations.yml -d"
echo $CMD
$CMD

3 changes: 1 addition & 2 deletions ycast/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def vtuner_redirect(url):
@app.route('/setupapp/<path:path>',
methods=['GET', 'POST'])
def upstream(path):
if request.args.get('token') == '0':
if request.args.get('token') == '0' or 'SignIn.asp' in path:
return vtuner.get_init_token()
if request.args.get('search'):
return station_search()
Expand Down Expand Up @@ -154,7 +154,6 @@ def landing(path=''):
page.set_count(1)
return page.to_string()


@app.route('/' + PATH_ROOT + '/' + PATH_MY_STATIONS + '/',
methods=['GET', 'POST'])
def my_stations_landing():
Expand Down

0 comments on commit be675d6

Please sign in to comment.