FROM alpine:3.21.2

LABEL org.opencontainers.image.authors="alier@student.42mulhouse.fr"

RUN apk add redis

HEALTHCHECK --start-period=5s \
    CMD [ "$(cat /run/secrets/redis_password | redis-cli --askpass ping)" = "PONG" ]

COPY tools/setup_redis.sh /setup_redis.sh

EXPOSE 6379

ENTRYPOINT ["sh", "setup_redis.sh"]