Adds Autotest and healthcheck.

This commit is contained in:
Werner Beroux
2020-07-29 19:19:38 +02:00
parent 39c5c689a8
commit f9cb694c2b
2 changed files with 9 additions and 0 deletions

View File

@@ -60,9 +60,15 @@ RUN set -ex \
# Runs as mopidy user by default.
USER mopidy
# Basic check,
RUN /usr/bin/dumb-init /entrypoint.sh /usr/bin/mopidy --version
VOLUME ["/var/lib/mopidy/local", "/var/lib/mopidy/media"]
EXPOSE 6600 6680 5555/udp
ENTRYPOINT ["/usr/bin/dumb-init", "/entrypoint.sh"]
CMD ["/usr/bin/mopidy"]
HEALTHCHECK --interval=5s --timeout=2s --retries=20 \
CMD curl --connect-timeout 5 --silent --show-error --fail http://localhost:6680/ || exit 1

3
docker-compose.test.yml Normal file
View File

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