Add project official docker image.
Tag for docker image is set from project version. To build docker image for the project run: - mvn package - mvn -N dockerfile:build Created docker image can be uploaded to the docker hub: - mvn -N dockerfile:push Signed-off-by: Yahor Berdnikau <egorr.berd@gmail.com>
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
*.md
|
||||
*.xml
|
||||
*.yml
|
||||
*.txt
|
||||
*.html
|
||||
|
||||
.gitignore
|
||||
.git/
|
||||
contrib/
|
||||
airsonic-main/
|
||||
!airsonic-main/target/airsonic.war
|
||||
subsonic-rest-api/
|
||||
airsonic-sonos-api/
|
||||
repo/
|
||||
target/
|
||||
+27
@@ -0,0 +1,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
|
||||
|
||||
WORKDIR $AIRSONIC_DIR
|
||||
|
||||
COPY dockerfiles/run.sh /usr/local/bin/run.sh
|
||||
COPY airsonic-main/target/airsonic.war airsonic.war
|
||||
|
||||
RUN apk --no-cache add \
|
||||
ffmpeg \
|
||||
lame \
|
||||
su-exec \
|
||||
libressl \
|
||||
ca-certificates \
|
||||
tini \
|
||||
openjdk8-jre \
|
||||
&& chmod +x /usr/local/bin/run.sh
|
||||
|
||||
EXPOSE $AIRSONIC_PORT
|
||||
|
||||
VOLUME $AIRSONIC_DIR/data $AIRSONIC_DIR/music $AIRSONIC_DIR/playlists $AIRSONIC_DIR/podcasts
|
||||
|
||||
ENTRYPOINT ["run.sh"]
|
||||
Executable
+19
@@ -0,0 +1,19 @@
|
||||
#!/bin/sh
|
||||
|
||||
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
|
||||
|
||||
chown -R $UID:$GID $AIRSONIC_DIR/data $AIRSONIC_DIR/playlists $AIRSONIC_DIR/podcasts
|
||||
|
||||
exec su-exec $UID:$GID tini -- \
|
||||
java -Xmx256m \
|
||||
-Dserver.host=0.0.0.0 \
|
||||
-Dserver.port=$AIRSONIC_PORT \
|
||||
-Dserver.contextPath=/ \
|
||||
-Dairsonic.home=$AIRSONIC_DIR/data \
|
||||
-Dairsonic.defaultMusicFolder=$AIRSONIC_DIR/musics \
|
||||
-Dairsonic.defaultPodcastFolder=$AIRSONIC_DIR/podcasts \
|
||||
-Dairsonic.defaultPlaylistFolder=$AIRSONIC_DIR/playlists \
|
||||
-Djava.awt.headless=true \
|
||||
-jar airsonic.war
|
||||
@@ -169,6 +169,16 @@
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>com.spotify</groupId>
|
||||
<artifactId>dockerfile-maven-plugin</artifactId>
|
||||
<version>1.3.4</version>
|
||||
<inherited>false</inherited>
|
||||
<configuration>
|
||||
<repository>airsonic/airsonic</repository>
|
||||
<tag>${project.version}</tag>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</pluginManagement>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user