2023-08-28 12:41:57 -07:00
|
|
|
import { PostgreSqlContainer } from '@testcontainers/postgresql';
|
2023-08-29 02:01:42 -07:00
|
|
|
import { GenericContainer } from 'testcontainers';
|
2023-07-11 14:54:44 -07:00
|
|
|
export default async () => {
|
|
|
|
process.env.NODE_ENV = 'development';
|
|
|
|
process.env.TYPESENSE_API_KEY = 'abc123';
|
|
|
|
|
|
|
|
const pg = await new PostgreSqlContainer('postgres')
|
|
|
|
.withExposedPorts(5432)
|
|
|
|
.withDatabase('immich')
|
|
|
|
.withUsername('postgres')
|
|
|
|
.withPassword('postgres')
|
2023-08-01 08:49:50 -07:00
|
|
|
.withReuse()
|
2023-07-11 14:54:44 -07:00
|
|
|
.start();
|
|
|
|
|
2023-08-01 08:49:50 -07:00
|
|
|
process.env.DB_URL = pg.getConnectionUri();
|
2023-07-11 14:54:44 -07:00
|
|
|
|
2023-08-01 08:49:50 -07:00
|
|
|
const redis = await new GenericContainer('redis').withExposedPorts(6379).withReuse().start();
|
2023-07-11 14:54:44 -07:00
|
|
|
|
|
|
|
process.env.REDIS_PORT = String(redis.getMappedPort(6379));
|
|
|
|
process.env.REDIS_HOSTNAME = redis.getHost();
|
|
|
|
};
|