Skip to content

Commit

Permalink
refactor: docker.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
alexey-yarmosh committed Apr 12, 2024
1 parent 922fec8 commit 173acb9
Showing 1 changed file with 1 addition and 19 deletions.
20 changes: 1 addition & 19 deletions test/e2e/docker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ class DockerManager {
}

public async createApiContainer () {
const networkMode = 'bridge';
const redisUrl = config.get<string>('redis.url').replace('localhost', 'host.docker.internal');
const dbConnectionHost = config.get<string>('db.connection.host').replace('localhost', 'host.docker.internal');
const processes = config.get<string>('server.processes');
Expand All @@ -34,7 +33,6 @@ class DockerManager {
PortBindings: {
'80/tcp': [{ HostPort: '80' }],
},
NetworkMode: networkMode,
ExtraHosts: [ 'host.docker.internal:host-gateway' ],
},
});
Expand All @@ -44,30 +42,14 @@ class DockerManager {
}

public async createProbeContainer () {
const networkMode = 'bridge';
const apiHost = 'ws://localhost:80'.replace('localhost', 'host.docker.internal');

// docker run -e API_HOST=ws://host.docker.internal:80 --name globalping-probe-e2e globalping-probe-e2e
console.log({
Image: 'globalping-probe-e2e',
name: 'globalping-probe-e2e',
Env: [
`API_HOST=${apiHost}`,
],
HostConfig: {
NetworkMode: networkMode,
ExtraHosts: [ 'host.docker.internal:host-gateway' ],
},
});

const container = await this.docker.createContainer({
Image: 'globalping-probe-e2e',
name: 'globalping-probe-e2e',
Env: [
`API_HOST=${apiHost}`,
'API_HOST=ws://host.docker.internal:80',
],
HostConfig: {
NetworkMode: networkMode,
ExtraHosts: [ 'host.docker.internal:host-gateway' ],
},
});
Expand Down

0 comments on commit 173acb9

Please sign in to comment.