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

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

public class RedisTestContainer extends GenericContainer<RedisTestContainer> {

    private static final String IMAGE_VERSION = "redis:6.2.6";
    private static RedisTestContainer container;


    private RedisTestContainer() {

        super(DockerImageName.parse(IMAGE_VERSION));
    }


    public static RedisTestContainer getInstance() {

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

}
