Skip to content

Commit f9cb694

Browse files
committed
Adds Autotest and healthcheck.
1 parent 39c5c68 commit f9cb694

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

Dockerfile

+6
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,15 @@ RUN set -ex \
6060
# Runs as mopidy user by default.
6161
USER mopidy
6262

63+
# Basic check,
64+
RUN /usr/bin/dumb-init /entrypoint.sh /usr/bin/mopidy --version
65+
6366
VOLUME ["/var/lib/mopidy/local", "/var/lib/mopidy/media"]
6467

6568
EXPOSE 6600 6680 5555/udp
6669

6770
ENTRYPOINT ["/usr/bin/dumb-init", "/entrypoint.sh"]
6871
CMD ["/usr/bin/mopidy"]
72+
73+
HEALTHCHECK --interval=5s --timeout=2s --retries=20 \
74+
CMD curl --connect-timeout 5 --silent --show-error --fail http://localhost:6680/ || exit 1

docker-compose.test.yml

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
sut:
2+
build: .
3+
command: sh -c '(mopidy &) && sleep 5 && curl --connect-timeout 5 --show-error --fail http://localhost:6680/'

0 commit comments

Comments
 (0)