-
Notifications
You must be signed in to change notification settings - Fork 96
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
58 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters