package at.procon.dip;

import org.testcontainers.containers.PostgreSQLContainer;

public class FixedPortPostgreSQLContainer<SELF extends FixedPortPostgreSQLContainer<SELF>>
        extends PostgreSQLContainer<SELF> {

    private final int hostPort;

    public FixedPortPostgreSQLContainer(String imageName, int hostPort) {
        super(imageName);
        this.hostPort = hostPort;
    }

    @Override
    protected void configure() {
        super.configure();
        addFixedExposedPort(hostPort, PostgreSQLContainer.POSTGRESQL_PORT);
    }
}