fix database transformer

This commit is contained in:
Simon Larsen
2022-06-06 12:00:39 +01:00
parent 4fe80e0e4e
commit b8c1e47c73
12 changed files with 552 additions and 512 deletions

View File

@@ -24,6 +24,21 @@ import ObjectID from '../Types/ObjectID';
import AccessControl from '../Types/Database/AccessControls/AccessControl';
import Dictionary from '../Types/Dictionary';
import HashedString from '../Types/HashedString';
import Email from '../Types/Email';
import Phone from '../Types/Phone';
import PositiveNumber from '../Types/PositiveNumber';
export type DbTypes =
string |
number |
PositiveNumber |
Email |
HashedString |
URL |
Phone |
JSONObject |
JSONArray |
Buffer;
export default class BaseModel extends BaseEntity {
@TableColumn({ title: 'ID' })
@@ -137,6 +152,18 @@ export default class BaseModel extends BaseEntity {
return new Columns(Object.keys(getTableColumns(this)));
}
public hasValue(columnName: string) {
return !!(this as any)[columnName];
}
public getValue<T extends DbTypes>(columnName: string): T {
return (this as any)[columnName] as T;
}
public setValue<T extends DbTypes>(columnName: string, value: T) {
return (this as any)[columnName] = value;
}
public getUniqueColumns(): Columns {
const dictionary: Dictionary<TableColumnMetadata> =
getTableColumns(this);

View File

@@ -81,6 +81,7 @@ class User extends BaseModel {
length: ColumnLength.HashedString,
unique: false,
nullable: true,
transformer: HashedString.getDatabaseTransformer()
})
public password?: HashedString = undefined;

View File

@@ -98,10 +98,10 @@ export default class URL extends DatabaseProperty {
}
protected static override toDatabase(
_value: URL | FindOperator<URL>
value: URL | FindOperator<URL>
): string | null {
if (_value) {
return _value.toString();
if (value) {
return value.toString();
}
return null;

View File

@@ -75,10 +75,10 @@ export default class Email extends DatabaseProperty {
}
public static override toDatabase(
_value: Email | FindOperator<Email>
value: Email | FindOperator<Email>
): string | null {
if (_value) {
return _value.toString();
if (value) {
return value.toString();
}
return null;

View File

@@ -2,8 +2,8 @@ import { FindOperator } from 'typeorm';
import UUID from '../Utils/UUID';
import DatabaseProperty from './Database/DatabaseProperty';
import BadOperationException from './Exception/BadOperationException';
import EncryptionAlgorithm from './EncryptionAlgorithm';
import ObjectID from './ObjectID';
import CryptoJS from 'crypto-js';
export default class HashedString extends DatabaseProperty {
private isHashed: boolean = false;
@@ -31,10 +31,11 @@ export default class HashedString extends DatabaseProperty {
}
protected static override toDatabase(
_value: HashedString | FindOperator<HashedString>
value: HashedString | FindOperator<HashedString>
): string | null {
if (_value) {
return _value.toString();
if (value) {
return value.toString();
}
return null;
@@ -56,26 +57,9 @@ export default class HashedString extends DatabaseProperty {
const valueToHash: string = (encryptionSecret || '') + this.value;
this.isHashed = true;
// encode as UTF-8
const msgBuffer: Uint8Array = new TextEncoder().encode(valueToHash);
// hash the message
const hashBuffer: ArrayBuffer = await crypto.subtle.digest(
EncryptionAlgorithm.SHA256,
msgBuffer
);
// convert ArrayBuffer to Array
const hashArray: Array<number> = Array.from(new Uint8Array(hashBuffer));
// convert bytes to hex string
const hashHex: string = hashArray
.map((b: number) => {
return b.toString(16).padStart(2, '0');
})
.join('');
this.value = hashHex;
return hashHex;
this.value = CryptoJS.SHA256(valueToHash).toString();
return this.value;
}
public static async hashValue(

View File

@@ -26,10 +26,10 @@ export default class ObjectID extends DatabaseProperty {
}
protected static override toDatabase(
_value: ObjectID | FindOperator<ObjectID>
value: ObjectID | FindOperator<ObjectID>
): string | null {
if (_value) {
return _value.toString();
if (value) {
return value.toString();
}
return null;

View File

@@ -27,10 +27,10 @@ export default class Version extends DatabaseProperty {
}
protected static override toDatabase(
_value: Version | FindOperator<Version>
value: Version | FindOperator<Version>
): string | null {
if (_value) {
return _value.toString();
if (value) {
return value.toString();
}
return null;

View File

@@ -9,9 +9,11 @@
"version": "1.0.0",
"license": "MIT",
"dependencies": {
"@types/crypto-js": "^4.1.1",
"@types/nanoid-dictionary": "^4.2.0",
"@types/uuid": "^8.3.4",
"axios": "^0.26.1",
"crypto-js": "^4.1.1",
"moment": "^2.29.2",
"nanoid": "^3.3.2",
"nanoid-dictionary": "^4.3.0",
@@ -952,6 +954,11 @@
"@babel/types": "^7.3.0"
}
},
"node_modules/@types/crypto-js": {
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/@types/crypto-js/-/crypto-js-4.1.1.tgz",
"integrity": "sha512-BG7fQKZ689HIoc5h+6D2Dgq1fABRa0RbBWKBd9SP/MVRVXROflpm5fhwyATX5duFmbStzyzyycPB8qUYKDH3NA=="
},
"node_modules/@types/graceful-fs": {
"version": "4.1.5",
"resolved": "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.5.tgz",
@@ -1584,6 +1591,11 @@
"node": ">= 8"
}
},
"node_modules/crypto-js": {
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/crypto-js/-/crypto-js-4.1.1.tgz",
"integrity": "sha512-o2JlM7ydqd3Qk9CA0L4NL6mTzU2sdx96a+oOfPu8Mkl/PK51vSyoi8/rQ8NknZtk44vq15lmhAj9CIAGwgeWKw=="
},
"node_modules/cssom": {
"version": "0.4.4",
"resolved": "https://registry.npmjs.org/cssom/-/cssom-0.4.4.tgz",
@@ -5274,6 +5286,11 @@
"@babel/types": "^7.3.0"
}
},
"@types/crypto-js": {
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/@types/crypto-js/-/crypto-js-4.1.1.tgz",
"integrity": "sha512-BG7fQKZ689HIoc5h+6D2Dgq1fABRa0RbBWKBd9SP/MVRVXROflpm5fhwyATX5duFmbStzyzyycPB8qUYKDH3NA=="
},
"@types/graceful-fs": {
"version": "4.1.5",
"resolved": "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.5.tgz",
@@ -5755,6 +5772,11 @@
"which": "^2.0.1"
}
},
"crypto-js": {
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/crypto-js/-/crypto-js-4.1.1.tgz",
"integrity": "sha512-o2JlM7ydqd3Qk9CA0L4NL6mTzU2sdx96a+oOfPu8Mkl/PK51vSyoi8/rQ8NknZtk44vq15lmhAj9CIAGwgeWKw=="
},
"cssom": {
"version": "0.4.4",
"resolved": "https://registry.npmjs.org/cssom/-/cssom-0.4.4.tgz",

View File

@@ -17,9 +17,11 @@
"ts-jest": "^27.1.4"
},
"dependencies": {
"@types/crypto-js": "^4.1.1",
"@types/nanoid-dictionary": "^4.2.0",
"@types/uuid": "^8.3.4",
"axios": "^0.26.1",
"crypto-js": "^4.1.1",
"moment": "^2.29.2",
"nanoid": "^3.3.2",
"nanoid-dictionary": "^4.3.0",

View File

@@ -28,6 +28,7 @@ import HashedString from 'Common/Types/HashedString';
import UpdateByID from '../Types/DB/UpdateByID';
import ObjectID from 'Common/Types/ObjectID';
import Role from 'Common/Types/Role';
import Columns from 'Common/Types/Database/Columns';
class DatabaseService<TBaseModel extends BaseModel> {
private postgresDatabase!: PostgresDatabase;
@@ -121,10 +122,13 @@ class DatabaseService<TBaseModel extends BaseModel> {
}
protected async hash(data: TBaseModel): Promise<TBaseModel> {
for (const key of data.getHashedColumns().columns) {
const columns: Columns = data.getHashedColumns();
for (const key of columns.columns) {
if (
(data as any)[key] &&
!((data as any)[key] as HashedString).isValueHashed
data.hasValue(key) &&
!((data.getValue(key) as HashedString).isValueHashed())
) {
await ((data as any)[key] as HashedString).hashValue(
EncryptionSecret
@@ -140,8 +144,8 @@ class DatabaseService<TBaseModel extends BaseModel> {
for (const key of data.getEncryptedColumns().columns) {
// If data is an object.
if (typeof (data as any)[key] === 'object') {
const dataObj: JSONObject = (data as any)[key];
if (typeof data.getValue(key) === 'object') {
const dataObj: JSONObject = data.getValue(key) as JSONObject;
for (const key in dataObj) {
dataObj[key] = Encryption.decrypt(
@@ -150,10 +154,10 @@ class DatabaseService<TBaseModel extends BaseModel> {
);
}
(data as any)[key] = dataObj;
data.setValue(key, dataObj);
} else {
//If its string or other type.
(data as any)[key] = Encryption.decrypt((data as any)[key], iv);
data.setValue(key, Encryption.decrypt((data as any)[key], iv));
}
}

View File

@@ -46,9 +46,9 @@ server {
ssl_certificate /etc/nginx/certs/nginx.crt;
ssl_certificate_key /etc/nginx/certs/nginx.key;
location / {
proxy_pass http://home/;
}
# location / {
# proxy_pass http://home/;
# }
location /accounts {
proxy_set_header Host $host;

View File

@@ -106,214 +106,214 @@ services:
- /usr/src/CommonServer/node_modules/
data-ingestor:
ports:
- '3200:3200'
- '9338:9229' # Debugging port.
build:
network: host
context: .
dockerfile: ./DataIngestor/Dockerfile.dev
env_file:
- ./Common/.env
- ./CommonServer/.env
- ./DataIngestor/.env
environment: *common-variables
depends_on:
- script-runner
- dashboard-api
- realtime
volumes:
- ./DataIngestor:/usr/src/app
# Use node modules of the container and not host system.
# https://stackoverflow.com/questions/29181032/add-a-volume-to-docker-but-exclude-a-sub-folder
- /usr/src/app/node_modules/
- ./Common:/usr/src/Common
- ./CommonServer:/usr/src/CommonServer
- ./CommonUI:/usr/src/CommonUI
- /usr/src/Common/node_modules/
- /usr/src/CommonUI/node_modules/
- /usr/src/CommonServer/node_modules/
# data-ingestor:
# ports:
# - '3200:3200'
# - '9338:9229' # Debugging port.
# build:
# network: host
# context: .
# dockerfile: ./DataIngestor/Dockerfile.dev
# env_file:
# - ./Common/.env
# - ./CommonServer/.env
# - ./DataIngestor/.env
# environment: *common-variables
# depends_on:
# - script-runner
# - dashboard-api
# - realtime
# volumes:
# - ./DataIngestor:/usr/src/app
# # Use node modules of the container and not host system.
# # https://stackoverflow.com/questions/29181032/add-a-volume-to-docker-but-exclude-a-sub-folder
# - /usr/src/app/node_modules/
# - ./Common:/usr/src/Common
# - ./CommonServer:/usr/src/CommonServer
# - ./CommonUI:/usr/src/CommonUI
# - /usr/src/Common/node_modules/
# - /usr/src/CommonUI/node_modules/
# - /usr/src/CommonServer/node_modules/
realtime:
ports:
- '3300:3300'
- '9250:9229' # Debugging port.
build:
network: host
context: .
dockerfile: ./Realtime/Dockerfile.dev
env_file:
- ./Common/.env
- ./CommonServer/.env
- ./Realtime/.env
environment: *common-variables
volumes:
- ./Realtime:/usr/src/app
# Use node modules of the container and not host system.
# https://stackoverflow.com/questions/29181032/add-a-volume-to-docker-but-exclude-a-sub-folder
- /usr/src/app/node_modules/
- ./Common:/usr/src/Common
- ./CommonServer:/usr/src/CommonServer
- ./CommonUI:/usr/src/CommonUI
- /usr/src/Common/node_modules/
- /usr/src/CommonUI/node_modules/
- /usr/src/CommonServer/node_modules/
# realtime:
# ports:
# - '3300:3300'
# - '9250:9229' # Debugging port.
# build:
# network: host
# context: .
# dockerfile: ./Realtime/Dockerfile.dev
# env_file:
# - ./Common/.env
# - ./CommonServer/.env
# - ./Realtime/.env
# environment: *common-variables
# volumes:
# - ./Realtime:/usr/src/app
# # Use node modules of the container and not host system.
# # https://stackoverflow.com/questions/29181032/add-a-volume-to-docker-but-exclude-a-sub-folder
# - /usr/src/app/node_modules/
# - ./Common:/usr/src/Common
# - ./CommonServer:/usr/src/CommonServer
# - ./CommonUI:/usr/src/CommonUI
# - /usr/src/Common/node_modules/
# - /usr/src/CommonUI/node_modules/
# - /usr/src/CommonServer/node_modules/
helmchart:
ports:
- '3423:3423'
build:
network: host
context: .
dockerfile: ./HelmChart/Dockerfile
env_file:
- ./Common/.env
- ./CommonServer/.env
- ./HelmChart/.env
environment: *common-variables
volumes:
- ./HelmChart:/usr/src/app
# Use node modules of the container and not host system.
# https://stackoverflow.com/questions/29181032/add-a-volume-to-docker-but-exclude-a-sub-folder
- /usr/src/app/node_modules/
- ./Common:/usr/src/Common
- ./CommonServer:/usr/src/CommonServer
- ./CommonUI:/usr/src/CommonUI
- /usr/src/Common/node_modules/
- /usr/src/CommonUI/node_modules/
- /usr/src/CommonServer/node_modules/
# helmchart:
# ports:
# - '3423:3423'
# build:
# network: host
# context: .
# dockerfile: ./HelmChart/Dockerfile
# env_file:
# - ./Common/.env
# - ./CommonServer/.env
# - ./HelmChart/.env
# environment: *common-variables
# volumes:
# - ./HelmChart:/usr/src/app
# # Use node modules of the container and not host system.
# # https://stackoverflow.com/questions/29181032/add-a-volume-to-docker-but-exclude-a-sub-folder
# - /usr/src/app/node_modules/
# - ./Common:/usr/src/Common
# - ./CommonServer:/usr/src/CommonServer
# - ./CommonUI:/usr/src/CommonUI
# - /usr/src/Common/node_modules/
# - /usr/src/CommonUI/node_modules/
# - /usr/src/CommonServer/node_modules/
probe-api:
ports:
- '3400:3400'
- '9251:9229' # Debugging port.
build:
network: host
context: .
dockerfile: ./ProbeAPI/Dockerfile.dev
env_file:
- ./Common/.env
- ./CommonServer/.env
- ./ProbeAPI/.env
environment: *common-variables
volumes:
- ./ProbeAPI:/usr/src/app
# Use node modules of the container and not host system.
# https://stackoverflow.com/questions/29181032/add-a-volume-to-docker-but-exclude-a-sub-folder
- /usr/src/app/node_modules/
- ./Common:/usr/src/Common
- ./CommonServer:/usr/src/CommonServer
- ./CommonUI:/usr/src/CommonUI
- /usr/src/Common/node_modules/
- /usr/src/CommonUI/node_modules/
- /usr/src/CommonServer/node_modules/
# probe-api:
# ports:
# - '3400:3400'
# - '9251:9229' # Debugging port.
# build:
# network: host
# context: .
# dockerfile: ./ProbeAPI/Dockerfile.dev
# env_file:
# - ./Common/.env
# - ./CommonServer/.env
# - ./ProbeAPI/.env
# environment: *common-variables
# volumes:
# - ./ProbeAPI:/usr/src/app
# # Use node modules of the container and not host system.
# # https://stackoverflow.com/questions/29181032/add-a-volume-to-docker-but-exclude-a-sub-folder
# - /usr/src/app/node_modules/
# - ./Common:/usr/src/Common
# - ./CommonServer:/usr/src/CommonServer
# - ./CommonUI:/usr/src/CommonUI
# - /usr/src/Common/node_modules/
# - /usr/src/CommonUI/node_modules/
# - /usr/src/CommonServer/node_modules/
# There can only be one probe in developer docker compose.
probe:
ports:
- '9238:9229' # Debugging port.
build:
network: host
context: .
dockerfile: ./Probe/Dockerfile.dev
env_file:
- ./Common/.env
- ./CommonServer/.env
- ./Probe/.env
environment:
<<: *common-variables
PROBE_NAME: Probe 1
PROBE_KEY: test-key
volumes:
- ./Probe:/usr/src/app
# Use node modules of the container and not host system.
# https://stackoverflow.com/questions/29181032/add-a-volume-to-docker-but-exclude-a-sub-folder
- /usr/src/app/node_modules/
- ./Common:/usr/src/Common
- ./CommonServer:/usr/src/CommonServer
- ./CommonUI:/usr/src/CommonUI
- /usr/src/Common/node_modules/
- /usr/src/CommonUI/node_modules/
- /usr/src/CommonServer/node_modules/
# # There can only be one probe in developer docker compose.
# probe:
# ports:
# - '9238:9229' # Debugging port.
# build:
# network: host
# context: .
# dockerfile: ./Probe/Dockerfile.dev
# env_file:
# - ./Common/.env
# - ./CommonServer/.env
# - ./Probe/.env
# environment:
# <<: *common-variables
# PROBE_NAME: Probe 1
# PROBE_KEY: test-key
# volumes:
# - ./Probe:/usr/src/app
# # Use node modules of the container and not host system.
# # https://stackoverflow.com/questions/29181032/add-a-volume-to-docker-but-exclude-a-sub-folder
# - /usr/src/app/node_modules/
# - ./Common:/usr/src/Common
# - ./CommonServer:/usr/src/CommonServer
# - ./CommonUI:/usr/src/CommonUI
# - /usr/src/Common/node_modules/
# - /usr/src/CommonUI/node_modules/
# - /usr/src/CommonServer/node_modules/
api-docs:
ports:
- '1445:1445'
build:
network: host
context: .
dockerfile: ./ApiDocs/Dockerfile.dev
env_file:
- ./Common/.env
- ./CommonServer/.env
- ./ApiDocs/.env
environment: *common-variables
volumes:
- ./ApiDocs:/usr/src/app
# Use node modules of the container and not host system.
# https://stackoverflow.com/questions/29181032/add-a-volume-to-docker-but-exclude-a-sub-folder
- /usr/src/app/node_modules/
- ./Common:/usr/src/Common
- ./CommonServer:/usr/src/CommonServer
- ./CommonUI:/usr/src/CommonUI
- /usr/src/Common/node_modules/
- /usr/src/CommonUI/node_modules/
- /usr/src/CommonServer/node_modules/
# api-docs:
# ports:
# - '1445:1445'
# build:
# network: host
# context: .
# dockerfile: ./ApiDocs/Dockerfile.dev
# env_file:
# - ./Common/.env
# - ./CommonServer/.env
# - ./ApiDocs/.env
# environment: *common-variables
# volumes:
# - ./ApiDocs:/usr/src/app
# # Use node modules of the container and not host system.
# # https://stackoverflow.com/questions/29181032/add-a-volume-to-docker-but-exclude-a-sub-folder
# - /usr/src/app/node_modules/
# - ./Common:/usr/src/Common
# - ./CommonServer:/usr/src/CommonServer
# - ./CommonUI:/usr/src/CommonUI
# - /usr/src/Common/node_modules/
# - /usr/src/CommonUI/node_modules/
# - /usr/src/CommonServer/node_modules/
script-runner:
ports:
- '3009:3009'
- '9236:9229' # Debugging port.
build:
network: host
context: .
dockerfile: ./ScriptRunner/Dockerfile.dev
env_file:
- ./Common/.env
- ./CommonServer/.env
- ./ScriptRunner/.env
environment: *common-variables
volumes:
- ./ScriptRunner:/usr/src/app
# Use node modules of the container and not host system.
# https://stackoverflow.com/questions/29181032/add-a-volume-to-docker-but-exclude-a-sub-folder
- /usr/src/app/node_modules/
- ./Common:/usr/src/Common
- ./CommonServer:/usr/src/CommonServer
- ./CommonUI:/usr/src/CommonUI
- /usr/src/Common/node_modules/
- /usr/src/CommonUI/node_modules/
- /usr/src/CommonServer/node_modules/
# script-runner:
# ports:
# - '3009:3009'
# - '9236:9229' # Debugging port.
# build:
# network: host
# context: .
# dockerfile: ./ScriptRunner/Dockerfile.dev
# env_file:
# - ./Common/.env
# - ./CommonServer/.env
# - ./ScriptRunner/.env
# environment: *common-variables
# volumes:
# - ./ScriptRunner:/usr/src/app
# # Use node modules of the container and not host system.
# # https://stackoverflow.com/questions/29181032/add-a-volume-to-docker-but-exclude-a-sub-folder
# - /usr/src/app/node_modules/
# - ./Common:/usr/src/Common
# - ./CommonServer:/usr/src/CommonServer
# - ./CommonUI:/usr/src/CommonUI
# - /usr/src/Common/node_modules/
# - /usr/src/CommonUI/node_modules/
# - /usr/src/CommonServer/node_modules/
dashboard-api:
ports:
- '3002:3002' # Service Port.
- '9232:9229' # Debugging port.
build:
network: host
context: .
dockerfile: ./DashboardAPI/Dockerfile.dev
env_file:
- ./Common/.env
- ./CommonServer/.env
- ./DashboardAPI/.env
environment: *common-variables
depends_on:
- redis
volumes:
- ./DashboardAPI:/usr/src/app
# Use node modules of the container and not host system.
# https://stackoverflow.com/questions/29181032/add-a-volume-to-docker-but-exclude-a-sub-folder
- /usr/src/app/node_modules/
- ./Common:/usr/src/Common
- ./CommonServer:/usr/src/CommonServer
- ./CommonUI:/usr/src/CommonUI
- /usr/src/Common/node_modules/
- /usr/src/CommonUI/node_modules/
- /usr/src/CommonServer/node_modules/
# dashboard-api:
# ports:
# - '3002:3002' # Service Port.
# - '9232:9229' # Debugging port.
# build:
# network: host
# context: .
# dockerfile: ./DashboardAPI/Dockerfile.dev
# env_file:
# - ./Common/.env
# - ./CommonServer/.env
# - ./DashboardAPI/.env
# environment: *common-variables
# depends_on:
# - redis
# volumes:
# - ./DashboardAPI:/usr/src/app
# # Use node modules of the container and not host system.
# # https://stackoverflow.com/questions/29181032/add-a-volume-to-docker-but-exclude-a-sub-folder
# - /usr/src/app/node_modules/
# - ./Common:/usr/src/Common
# - ./CommonServer:/usr/src/CommonServer
# - ./CommonUI:/usr/src/CommonUI
# - /usr/src/Common/node_modules/
# - /usr/src/CommonUI/node_modules/
# - /usr/src/CommonServer/node_modules/
identity:
ports:
@@ -348,283 +348,283 @@ services:
- /usr/src/CommonUI/node_modules/
- /usr/src/CommonServer/node_modules/
alert:
ports:
- '3088:3088'
- '9133:9229' # Debugging port.
build:
network: host
context: .
dockerfile: ./Alert/Dockerfile.dev
env_file:
- ./Common/.env
- ./CommonServer/.env
- ./Alert/.env
environment: *common-variables
depends_on:
- redis
- postgres
volumes:
- ./Alert:/usr/src/app
# Use node modules of the container and not host system.
# https://stackoverflow.com/questions/29181032/add-a-volume-to-docker-but-exclude-a-sub-folder
- /usr/src/app/node_modules/
- ./Common:/usr/src/Common
- ./CommonServer:/usr/src/CommonServer
- ./CommonUI:/usr/src/CommonUI
- /usr/src/Common/node_modules/
- /usr/src/CommonUI/node_modules/
- /usr/src/CommonServer/node_modules/
# alert:
# ports:
# - '3088:3088'
# - '9133:9229' # Debugging port.
# build:
# network: host
# context: .
# dockerfile: ./Alert/Dockerfile.dev
# env_file:
# - ./Common/.env
# - ./CommonServer/.env
# - ./Alert/.env
# environment: *common-variables
# depends_on:
# - redis
# - postgres
# volumes:
# - ./Alert:/usr/src/app
# # Use node modules of the container and not host system.
# # https://stackoverflow.com/questions/29181032/add-a-volume-to-docker-but-exclude-a-sub-folder
# - /usr/src/app/node_modules/
# - ./Common:/usr/src/Common
# - ./CommonServer:/usr/src/CommonServer
# - ./CommonUI:/usr/src/CommonUI
# - /usr/src/Common/node_modules/
# - /usr/src/CommonUI/node_modules/
# - /usr/src/CommonServer/node_modules/
integration:
ports:
- '3089:3089'
- '9134:9229' # Debugging port.
build:
network: host
context: .
dockerfile: ./Integration/Dockerfile.dev
env_file:
- ./Common/.env
- ./CommonServer/.env
- ./Integration/.env
environment: *common-variables
depends_on:
- redis
- postgres
volumes:
- ./Integration:/usr/src/app
# Use node modules of the container and not host system.
# https://stackoverflow.com/questions/29181032/add-a-volume-to-docker-but-exclude-a-sub-folder
- /usr/src/app/node_modules/
- ./Common:/usr/src/Common
- ./CommonServer:/usr/src/CommonServer
- ./CommonUI:/usr/src/CommonUI
- /usr/src/Common/node_modules/
- /usr/src/CommonUI/node_modules/
- /usr/src/CommonServer/node_modules/
# integration:
# ports:
# - '3089:3089'
# - '9134:9229' # Debugging port.
# build:
# network: host
# context: .
# dockerfile: ./Integration/Dockerfile.dev
# env_file:
# - ./Common/.env
# - ./CommonServer/.env
# - ./Integration/.env
# environment: *common-variables
# depends_on:
# - redis
# - postgres
# volumes:
# - ./Integration:/usr/src/app
# # Use node modules of the container and not host system.
# # https://stackoverflow.com/questions/29181032/add-a-volume-to-docker-but-exclude-a-sub-folder
# - /usr/src/app/node_modules/
# - ./Common:/usr/src/Common
# - ./CommonServer:/usr/src/CommonServer
# - ./CommonUI:/usr/src/CommonUI
# - /usr/src/Common/node_modules/
# - /usr/src/CommonUI/node_modules/
# - /usr/src/CommonServer/node_modules/
dashboard:
ports:
- '3000:3000'
build:
network: host
context: .
dockerfile: ./dashboard/Dockerfile.dev
env_file:
- ./Common/.env
- ./CommonUI/.env
- ./Dashboard/.env
environment: *common-variables
volumes:
- ./Dashboard:/usr/src/app
# Use node modules of the container and not host system.
# https://stackoverflow.com/questions/29181032/add-a-volume-to-docker-but-exclude-a-sub-folder
- /usr/src/app/node_modules/
- ./Common:/usr/src/Common
- ./CommonServer:/usr/src/CommonServer
- ./CommonUI:/usr/src/CommonUI
- /usr/src/Common/node_modules/
- /usr/src/CommonUI/node_modules/
- /usr/src/CommonServer/node_modules/
# dashboard:
# ports:
# - '3000:3000'
# build:
# network: host
# context: .
# dockerfile: ./dashboard/Dockerfile.dev
# env_file:
# - ./Common/.env
# - ./CommonUI/.env
# - ./Dashboard/.env
# environment: *common-variables
# volumes:
# - ./Dashboard:/usr/src/app
# # Use node modules of the container and not host system.
# # https://stackoverflow.com/questions/29181032/add-a-volume-to-docker-but-exclude-a-sub-folder
# - /usr/src/app/node_modules/
# - ./Common:/usr/src/Common
# - ./CommonServer:/usr/src/CommonServer
# - ./CommonUI:/usr/src/CommonUI
# - /usr/src/Common/node_modules/
# - /usr/src/CommonUI/node_modules/
# - /usr/src/CommonServer/node_modules/
home:
ports:
- '1444:1444'
- '9235:9229' # Debugging port.
env_file:
- ./Common/.env
- ./CommonServer/.env
- ./Home/.env
environment: *common-variables
build:
network: host
context: .
dockerfile: ./Home/Dockerfile.dev
volumes:
- ./Home:/usr/src/app
# Use node modules of the container and not host system.
# https://stackoverflow.com/questions/29181032/add-a-volume-to-docker-but-exclude-a-sub-folder
- /usr/src/app/node_modules/
- ./Common:/usr/src/Common
- ./CommonServer:/usr/src/CommonServer
- ./CommonUI:/usr/src/CommonUI
- /usr/src/Common/node_modules/
- /usr/src/CommonUI/node_modules/
- /usr/src/CommonServer/node_modules/
# home:
# ports:
# - '1444:1444'
# - '9235:9229' # Debugging port.
# env_file:
# - ./Common/.env
# - ./CommonServer/.env
# - ./Home/.env
# environment: *common-variables
# build:
# network: host
# context: .
# dockerfile: ./Home/Dockerfile.dev
# volumes:
# - ./Home:/usr/src/app
# # Use node modules of the container and not host system.
# # https://stackoverflow.com/questions/29181032/add-a-volume-to-docker-but-exclude-a-sub-folder
# - /usr/src/app/node_modules/
# - ./Common:/usr/src/Common
# - ./CommonServer:/usr/src/CommonServer
# - ./CommonUI:/usr/src/CommonUI
# - /usr/src/Common/node_modules/
# - /usr/src/CommonUI/node_modules/
# - /usr/src/CommonServer/node_modules/
status-page:
ports:
- '3006:3006'
build:
network: host
context: .
dockerfile: ./StatusPage/Dockerfile.dev
env_file:
- ./Common/.env
- ./CommonUI/.env
- ./StatusPage/.env
environment: *common-variables
volumes:
- ./StatusPage:/usr/src/app
# Use node modules of the container and not host system.
# https://stackoverflow.com/questions/29181032/add-a-volume-to-docker-but-exclude-a-sub-folder
- /usr/src/app/node_modules/
- ./Common:/usr/src/Common
- ./CommonServer:/usr/src/CommonServer
- ./CommonUI:/usr/src/CommonUI
- /usr/src/Common/node_modules/
- /usr/src/CommonUI/node_modules/
- /usr/src/CommonServer/node_modules/
# status-page:
# ports:
# - '3006:3006'
# build:
# network: host
# context: .
# dockerfile: ./StatusPage/Dockerfile.dev
# env_file:
# - ./Common/.env
# - ./CommonUI/.env
# - ./StatusPage/.env
# environment: *common-variables
# volumes:
# - ./StatusPage:/usr/src/app
# # Use node modules of the container and not host system.
# # https://stackoverflow.com/questions/29181032/add-a-volume-to-docker-but-exclude-a-sub-folder
# - /usr/src/app/node_modules/
# - ./Common:/usr/src/Common
# - ./CommonServer:/usr/src/CommonServer
# - ./CommonUI:/usr/src/CommonUI
# - /usr/src/Common/node_modules/
# - /usr/src/CommonUI/node_modules/
# - /usr/src/CommonServer/node_modules/
admin-dashboard:
ports:
- '3100:3100'
build:
network: host
context: .
dockerfile: ./AdminDashboard/Dockerfile.dev
env_file:
- ./Common/.env
- ./CommonUI/.env
- ./AdminDashboard/.env
environment: *common-variables
volumes:
- ./AdminDashboard:/usr/src/app
# Use node modules of the container and not host system.
# https://stackoverflow.com/questions/29181032/add-a-volume-to-docker-but-exclude-a-sub-folder
- /usr/src/app/node_modules/
- ./Common:/usr/src/Common
- ./CommonServer:/usr/src/CommonServer
- ./CommonUI:/usr/src/CommonUI
- /usr/src/Common/node_modules/
- /usr/src/CommonUI/node_modules/
- /usr/src/CommonServer/node_modules/
# admin-dashboard:
# ports:
# - '3100:3100'
# build:
# network: host
# context: .
# dockerfile: ./AdminDashboard/Dockerfile.dev
# env_file:
# - ./Common/.env
# - ./CommonUI/.env
# - ./AdminDashboard/.env
# environment: *common-variables
# volumes:
# - ./AdminDashboard:/usr/src/app
# # Use node modules of the container and not host system.
# # https://stackoverflow.com/questions/29181032/add-a-volume-to-docker-but-exclude-a-sub-folder
# - /usr/src/app/node_modules/
# - ./Common:/usr/src/Common
# - ./CommonServer:/usr/src/CommonServer
# - ./CommonUI:/usr/src/CommonUI
# - /usr/src/Common/node_modules/
# - /usr/src/CommonUI/node_modules/
# - /usr/src/CommonServer/node_modules/
http-test-server:
ports:
- '3010:3010'
- '9234:9229' # Debugging port.
env_file:
- ./Common/.env
- ./CommonUI/.env
- ./HttpTestServer/.env
environment: *common-variables
build:
network: host
context: .
dockerfile: ./HTTPTestServer/Dockerfile.dev
volumes:
- ./HttpTestServer:/usr/src/app
# Use node modules of the container and not host system.
# https://stackoverflow.com/questions/29181032/add-a-volume-to-docker-but-exclude-a-sub-folder
- /usr/src/app/node_modules/
- ./Common:/usr/src/Common
- ./CommonServer:/usr/src/CommonServer
- ./CommonUI:/usr/src/CommonUI
- /usr/src/Common/node_modules/
- /usr/src/CommonUI/node_modules/
- /usr/src/CommonServer/node_modules/
# http-test-server:
# ports:
# - '3010:3010'
# - '9234:9229' # Debugging port.
# env_file:
# - ./Common/.env
# - ./CommonUI/.env
# - ./HttpTestServer/.env
# environment: *common-variables
# build:
# network: host
# context: .
# dockerfile: ./HTTPTestServer/Dockerfile.dev
# volumes:
# - ./HttpTestServer:/usr/src/app
# # Use node modules of the container and not host system.
# # https://stackoverflow.com/questions/29181032/add-a-volume-to-docker-but-exclude-a-sub-folder
# - /usr/src/app/node_modules/
# - ./Common:/usr/src/Common
# - ./CommonServer:/usr/src/CommonServer
# - ./CommonUI:/usr/src/CommonUI
# - /usr/src/Common/node_modules/
# - /usr/src/CommonUI/node_modules/
# - /usr/src/CommonServer/node_modules/
licensing:
ports:
- '3004:3004'
- '9233:9229' # Debugging port.
env_file:
- ./Common/.env
- ./CommonServer/.env
- ./Licensing/.env
environment: *common-variables
build:
network: host
context: .
dockerfile: ./Licensing/Dockerfile.dev
volumes:
- ./Licensing:/usr/src/app
# Use node modules of the container and not host system.
# https://stackoverflow.com/questions/29181032/add-a-volume-to-docker-but-exclude-a-sub-folder
- /usr/src/app/node_modules/
- ./Common:/usr/src/Common
- ./CommonServer:/usr/src/CommonServer
- ./CommonUI:/usr/src/CommonUI
- /usr/src/Common/node_modules/
- /usr/src/CommonUI/node_modules/
- /usr/src/CommonServer/node_modules/
# licensing:
# ports:
# - '3004:3004'
# - '9233:9229' # Debugging port.
# env_file:
# - ./Common/.env
# - ./CommonServer/.env
# - ./Licensing/.env
# environment: *common-variables
# build:
# network: host
# context: .
# dockerfile: ./Licensing/Dockerfile.dev
# volumes:
# - ./Licensing:/usr/src/app
# # Use node modules of the container and not host system.
# # https://stackoverflow.com/questions/29181032/add-a-volume-to-docker-but-exclude-a-sub-folder
# - /usr/src/app/node_modules/
# - ./Common:/usr/src/Common
# - ./CommonServer:/usr/src/CommonServer
# - ./CommonUI:/usr/src/CommonUI
# - /usr/src/Common/node_modules/
# - /usr/src/CommonUI/node_modules/
# - /usr/src/CommonServer/node_modules/
application-scanner:
ports:
- '3005:3005'
- '9240:9229' # Debugging port.
build:
network: host
context: .
dockerfile: ./ApplicationScanner/Dockerfile.dev
env_file:
- ./Common/.env
- ./CommonServer/.env
- ./ApplicationScanner/.env
environment: *common-variables
volumes:
- ./ApplicationScanner:/usr/src/app
# Use node modules of the container and not host system.
# https://stackoverflow.com/questions/29181032/add-a-volume-to-docker-but-exclude-a-sub-folder
- /usr/src/app/node_modules/
- ./Common:/usr/src/Common
- ./CommonServer:/usr/src/CommonServer
- ./CommonUI:/usr/src/CommonUI
- /usr/src/Common/node_modules/
- /usr/src/CommonUI/node_modules/
- /usr/src/CommonServer/node_modules/
# application-scanner:
# ports:
# - '3005:3005'
# - '9240:9229' # Debugging port.
# build:
# network: host
# context: .
# dockerfile: ./ApplicationScanner/Dockerfile.dev
# env_file:
# - ./Common/.env
# - ./CommonServer/.env
# - ./ApplicationScanner/.env
# environment: *common-variables
# volumes:
# - ./ApplicationScanner:/usr/src/app
# # Use node modules of the container and not host system.
# # https://stackoverflow.com/questions/29181032/add-a-volume-to-docker-but-exclude-a-sub-folder
# - /usr/src/app/node_modules/
# - ./Common:/usr/src/Common
# - ./CommonServer:/usr/src/CommonServer
# - ./CommonUI:/usr/src/CommonUI
# - /usr/src/Common/node_modules/
# - /usr/src/CommonUI/node_modules/
# - /usr/src/CommonServer/node_modules/
container-scanner:
ports:
- '3055:3055'
- '9242:9229' # Debugging port.
build:
network: host
context: .
dockerfile: ./ContainerScanner/Dockerfile.dev
env_file:
- ./Common/.env
- ./CommonServer/.env
- ./ContainerScanner/.env
environment: *common-variables
volumes:
- ./ContainerScanner:/usr/src/app
# Use node modules of the container and not host system.
# https://stackoverflow.com/questions/29181032/add-a-volume-to-docker-but-exclude-a-sub-folder
- /usr/src/app/node_modules/
- ./Common:/usr/src/Common
- ./CommonServer:/usr/src/CommonServer
- ./CommonUI:/usr/src/CommonUI
- /usr/src/Common/node_modules/
- /usr/src/CommonUI/node_modules/
- /usr/src/CommonServer/node_modules/
# container-scanner:
# ports:
# - '3055:3055'
# - '9242:9229' # Debugging port.
# build:
# network: host
# context: .
# dockerfile: ./ContainerScanner/Dockerfile.dev
# env_file:
# - ./Common/.env
# - ./CommonServer/.env
# - ./ContainerScanner/.env
# environment: *common-variables
# volumes:
# - ./ContainerScanner:/usr/src/app
# # Use node modules of the container and not host system.
# # https://stackoverflow.com/questions/29181032/add-a-volume-to-docker-but-exclude-a-sub-folder
# - /usr/src/app/node_modules/
# - ./Common:/usr/src/Common
# - ./CommonServer:/usr/src/CommonServer
# - ./CommonUI:/usr/src/CommonUI
# - /usr/src/Common/node_modules/
# - /usr/src/CommonUI/node_modules/
# - /usr/src/CommonServer/node_modules/
lighthouse-runner:
ports:
- '3015:3015'
- '9241:9229' # Debugging port.
build:
network: host
context: .
dockerfile: ./LighthouseRunner/Dockerfile.dev
env_file:
- ./Common/.env
- ./CommonServer/.env
- ./LighthouseRunner/.env
environment: *common-variables
volumes:
- ./LighthouseRunner:/usr/src/app
# Use node modules of the container and not host system.
# https://stackoverflow.com/questions/29181032/add-a-volume-to-docker-but-exclude-a-sub-folder
- /usr/src/app/node_modules/
- ./Common:/usr/src/Common
- ./CommonServer:/usr/src/CommonServer
- ./CommonUI:/usr/src/CommonUI
- /usr/src/Common/node_modules/
- /usr/src/CommonUI/node_modules/
- /usr/src/CommonServer/node_modules/
# lighthouse-runner:
# ports:
# - '3015:3015'
# - '9241:9229' # Debugging port.
# build:
# network: host
# context: .
# dockerfile: ./LighthouseRunner/Dockerfile.dev
# env_file:
# - ./Common/.env
# - ./CommonServer/.env
# - ./LighthouseRunner/.env
# environment: *common-variables
# volumes:
# - ./LighthouseRunner:/usr/src/app
# # Use node modules of the container and not host system.
# # https://stackoverflow.com/questions/29181032/add-a-volume-to-docker-but-exclude-a-sub-folder
# - /usr/src/app/node_modules/
# - ./Common:/usr/src/Common
# - ./CommonServer:/usr/src/CommonServer
# - ./CommonUI:/usr/src/CommonUI
# - /usr/src/Common/node_modules/
# - /usr/src/CommonUI/node_modules/
# - /usr/src/CommonServer/node_modules/
nginx:
depends_on:
- identity