Refactored dockerfile
Signed-off-by: Andrew DeMaria <lostonamountain@gmail.com>
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
!target/airsonic.war
|
||||
.gitignore
|
||||
pom.xml
|
||||
target/
|
||||
!target/dependency/*
|
||||
|
||||
@@ -3,25 +3,27 @@ FROM alpine:3.6
|
||||
LABEL description="Airsonic is a free, web-based media streamer, providing ubiquitious access to your music." \
|
||||
url="https://github.com/airsonic/airsonic"
|
||||
|
||||
ENV UID=1001 GID=1001 AIRSONIC_PORT=4040 AIRSONIC_DIR=/airsonic
|
||||
ENV AIRSONIC_PORT=4040 AIRSONIC_DIR=/airsonic
|
||||
|
||||
WORKDIR $AIRSONIC_DIR
|
||||
|
||||
COPY dockerfiles/run.sh /usr/local/bin/run.sh
|
||||
COPY target/dependency/airsonic-main-6.3-SNAPSHOT.war airsonic.war
|
||||
|
||||
RUN apk --no-cache add \
|
||||
ffmpeg \
|
||||
lame \
|
||||
su-exec \
|
||||
bash \
|
||||
libressl \
|
||||
ca-certificates \
|
||||
tini \
|
||||
openjdk8-jre \
|
||||
&& chmod +x /usr/local/bin/run.sh
|
||||
openjdk8-jre
|
||||
|
||||
COPY run.sh /usr/local/bin/run.sh
|
||||
|
||||
RUN chmod +x /usr/local/bin/run.sh
|
||||
|
||||
COPY target/dependency/airsonic-main-6.3-SNAPSHOT.war airsonic.war
|
||||
|
||||
EXPOSE $AIRSONIC_PORT
|
||||
|
||||
VOLUME $AIRSONIC_DIR/data $AIRSONIC_DIR/music $AIRSONIC_DIR/playlists $AIRSONIC_DIR/podcasts
|
||||
|
||||
ENTRYPOINT ["run.sh"]
|
||||
ENTRYPOINT ["tini", "--", "run.sh"]
|
||||
|
||||
@@ -39,6 +39,7 @@
|
||||
<configuration>
|
||||
<repository>airsonic/airsonic</repository>
|
||||
<tag>${project.version}</tag>
|
||||
<retryCount>0</retryCount>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
|
||||
+16
-7
@@ -1,13 +1,18 @@
|
||||
#!/bin/sh
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
mkdir -p $AIRSONIC_DIR/data/transcode
|
||||
ln -s /usr/bin/ffmpeg $AIRSONIC_DIR/data/transcode/ffmpeg
|
||||
ln -s /usr/bin/lame $AIRSONIC_DIR/data/transcode/lame
|
||||
ln -fs /usr/bin/ffmpeg $AIRSONIC_DIR/data/transcode/ffmpeg
|
||||
ln -fs /usr/bin/lame $AIRSONIC_DIR/data/transcode/lame
|
||||
|
||||
chown -R $UID:$GID $AIRSONIC_DIR/data $AIRSONIC_DIR/playlists $AIRSONIC_DIR/podcasts
|
||||
if [[ $# -lt 1 ]] || [[ ! "$1" == "java"* ]]; then
|
||||
|
||||
exec su-exec $UID:$GID tini -- \
|
||||
java -Xmx256m \
|
||||
java_opts_array=()
|
||||
while IFS= read -r -d '' item; do
|
||||
java_opts_array+=( "$item" )
|
||||
done < <([[ $JAVA_OPTS ]] && xargs printf '%s\0' <<<"$JAVA_OPTS")
|
||||
exec java -Xmx256m \
|
||||
-Dserver.host=0.0.0.0 \
|
||||
-Dserver.port=$AIRSONIC_PORT \
|
||||
-Dserver.contextPath=/ \
|
||||
@@ -16,4 +21,8 @@ exec su-exec $UID:$GID tini -- \
|
||||
-Dairsonic.defaultPodcastFolder=$AIRSONIC_DIR/podcasts \
|
||||
-Dairsonic.defaultPlaylistFolder=$AIRSONIC_DIR/playlists \
|
||||
-Djava.awt.headless=true \
|
||||
-jar airsonic.war
|
||||
"${java_opts_array[@]}" \
|
||||
-jar airsonic.war "$@"
|
||||
fi
|
||||
|
||||
exec "$@"
|
||||
|
||||
Reference in New Issue
Block a user