package com.iqser.red.service.peristence.v1.server.integration.utils;

import org.testcontainers.containers.GenericContainer;
import org.testcontainers.utility.DockerImageName;

public class KneconRedisTestContainer extends GenericContainer<KneconRedisTestContainer> {

    private static final String IMAGE_VERSION = "nexus.knecon.com:5001/bitnami/redis:7.0.5-debian-11-r7";
    private static KneconRedisTestContainer container;


    private KneconRedisTestContainer() {

        super(DockerImageName.parse(IMAGE_VERSION));
    }


    public static KneconRedisTestContainer getInstance() {

        if (container == null) {
            container = new KneconRedisTestContainer().withExposedPorts(6379);
        }
        return container;
    }

}
