Skip to content

Commit

Permalink
Merge pull request #12 from DEFRA/docker-fixes
Browse files Browse the repository at this point in the history
Docker fixes
  • Loading branch information
christopherjturner authored Dec 17, 2024
2 parents 4fd2abb + 74e5aea commit 6500b61
Show file tree
Hide file tree
Showing 6 changed files with 64 additions and 21 deletions.
1 change: 1 addition & 0 deletions compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ services:
- ./docker/config/cdp-portal-frontend.env
environment:
- PORT=3000
- NODE_ENV=development # This is required for the login cooke it work
depends_on:
cdp-portal-backend:
condition: service_started
Expand Down
2 changes: 1 addition & 1 deletion docker/config/cdp-portal-frontend.env
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
APP_BASE_URL=http://localhost:3000
APP_BASE_URL=http://cdp-portal-frontend:3000
USE_SINGLE_INSTANCE_CACHE=true
TERMINAL_PROXY_URL=http://localhost:8085
NODE_ENV=development # This is required to ensure the login cookie is set as insecure, as we test over http
2 changes: 1 addition & 1 deletion docker/config/defaults.env
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ TRUSTSTORE_CDP_ROOT_CA=LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUI5akNDQVYrZ0F3S
AZURE_CLIENT_SECRET=test_value
AZURE_TENANT_ID=63983fc2-cfff-45bb-8ec2-959e21062b9a
OIDC_AUDIENCE=63983fc2-cfff-45bb-8ec2-959e21062b9a
OIDC_WELL_KNOWN_CONFIGURATION_URL=http://cdp.127.0.0.1.sslip.io:3939/63983fc2-cfff-45bb-8ec2-959e21062b9a/v2.0/.well-known/openid-configuration
OIDC_WELL_KNOWN_CONFIGURATION_URL=http://cdp-portal-stubs:3939/63983fc2-cfff-45bb-8ec2-959e21062b9a/v2.0/.well-known/openid-configuration

GITHUB_BASE_URL=http://cdp-portal-stubs:3939
PORTAL_BACKEND_URL=http://cdp-portal-backend:5094
Expand Down
4 changes: 4 additions & 0 deletions docker/scripts/mongodb/10-cdp-user-service-backend-users.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ db.users.updateOne(
createdAt: "2023-10-26T12:51:00.028Z",
updatedAt: "2023-10-26T12:51:00.028Z",
teams: ["aabe63e7-87ef-4beb-a596-c810631fc474"],
scopes: [
new ObjectId("6750708d454fcbbcc1568154")
],
},
},
{ upsert: true }
Expand All @@ -35,6 +38,7 @@ db.users.updateOne(
createdAt: "2024-11-11T13:51:00.028Z",
updatedAt: "2024-11-12T13:24:00.028Z",
teams: ["44c7fa74-40e7-470d-a18a-b78a60bbef8e"],
scopes:[]
},
},
{ upsert: true }
Expand Down
69 changes: 56 additions & 13 deletions docker/scripts/mongodb/15-cdp-user-service-backend-teams.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,44 @@
db = db.getSiblingDB("cdp-user-service-backend");

db.scopes.updateOne(
{
value: "externalTest"
},
{
$setOnInsert: {
_id: new ObjectId("674def9d30093e3a3aa49d35"),
userId: "90552794-0613-4023-819a-512aa9d40023",
value: "externalTest",
teams: [
"aabe63e7-87ef-4beb-a596-c810631fc474"
],
createdAt: "2024-12-02T17:34:21.295Z",
updatedAt: "2024-12-02T17:34:21.295Z"
},
},
{ upsert: true }
);

db.scopes.updateOne(
{
value: "breakglass"
},
{
$setOnInsert: {
_id: new ObjectId("6750708d454fcbbcc1568154"),
userId: "90552794-0613-4023-819a-512aa9d40023",
value: "breakGlass",
teams: [
],
createdAt: "2024-12-02T17:34:21.295Z",
updatedAt: "2024-12-02T17:34:21.295Z"
},

},
{ upsert: true }
);


db.teams.updateOne(
{
name: "Platform",
Expand All @@ -11,6 +50,9 @@ db.teams.updateOne(
description: "The team that runs the platform",
github: "cdp-platform",
users: ["90552794-0613-4023-819a-512aa9d40023"],
scopes: [
new ObjectId("674def9d30093e3a3aa49d35")
],
createdAt: "2023-10-26T12:51:00.028Z",
updatedAt: "2023-10-26T12:51:00.028Z",
},
Expand All @@ -19,19 +61,20 @@ db.teams.updateOne(
);

db.teams.updateOne(
{
{
name: "TenantTeam1",
},
{
$setOnInsert: {
_id: "44c7fa74-40e7-470d-a18a-b78a60bbef8e",
name: "TenantTeam1",
description: "A test team",
github: "cdp-tenant-1",
users: [],
scopes: [],
createdAt: "2024-10-26T12:51:00.028Z",
updatedAt: "2024-10-26T12:55:00.028Z",
},
{
$setOnInsert: {
_id: "44c7fa74-40e7-470d-a18a-b78a60bbef8e",
name: "TenantTeam1",
description: "A test team",
github: "cdp-tenant-1",
users: [],
createdAt: "2024-10-26T12:51:00.028Z",
updatedAt: "2024-10-26T12:55:00.028Z",
},
},
{ upsert: true }
},
{ upsert: true }
);
7 changes: 1 addition & 6 deletions wdio.github.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export const config = {
// with `/`, the base url gets prepended, not including the path portion of your baseUrl.
// If your `url` parameter starts without a scheme or `/` (like `some/path`), the base url
// gets prepended directly.
baseUrl: `http://localhost:3000`,
baseUrl: `http://cdp-portal-frontend:3000`,

// Connection to remote chromedriver
hostname: process.env.CHROMEDRIVER_URL || '127.0.0.1',
Expand All @@ -29,11 +29,6 @@ export const config = {
{
browserName: 'chrome',
// Outbound calls must go via the proxy
proxy: {
proxyType: 'manual',
httpProxy: 'localhost:3128',
sslProxy: 'localhost:3128'
},
'goog:chromeOptions': {
args: [
'--no-sandbox',
Expand Down

0 comments on commit 6500b61

Please sign in to comment.