diff --git a/backend/configs/gpSql.config.ts b/backend/configs/gpSql.config.ts index 69deaf2..886e4fd 100644 --- a/backend/configs/gpSql.config.ts +++ b/backend/configs/gpSql.config.ts @@ -1,10 +1,17 @@ import type sql from "mssql"; -const username = "gpviewer"; -const password = "gp$$ViewOnly!"; +const username = process.env.GP_USER ?? "gpviewer"; +const password = process.env.GP_PASSWORD ?? "gp$$ViewOnly!"; + +const gpServer = process.env.GP_SERVER ?? "USMCD1VMS011"; + +const port = process.env.SQL_PORT + ? Number.parseInt(process.env.SQL_PORT, 10) + : undefined; export const gpSqlConfig: sql.config = { - server: `USMCD1VMS011`, + server: gpServer, + port: port, database: `ALPLA`, user: username, password: password, diff --git a/backend/configs/prodSql.config.ts b/backend/configs/prodSql.config.ts index 5e2e747..0e92256 100644 --- a/backend/configs/prodSql.config.ts +++ b/backend/configs/prodSql.config.ts @@ -1,7 +1,13 @@ import type sql from "mssql"; + +const port = process.env.SQL_PORT + ? Number.parseInt(process.env.SQL_PORT, 10) + : undefined; + export const prodSqlConfig: sql.config = { server: `${process.env.PROD_SERVER}`, database: `AlplaPROD_${process.env.PROD_PLANT_TOKEN}_cus`, + port: port, user: process.env.PROD_USER, password: process.env.PROD_PASSWORD, options: { diff --git a/docker-compose.yml b/docker-compose.yml index a187a69..5fbee7e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -12,48 +12,36 @@ services: #- "${VITE_PORT:-4200}:4200" - "3600:3000" dns: - - 10.193.9.250 - - 10.193.9.251 # your internal DNS server - dns_search: - - alpla.net # or your internal search suffix + - 10.44.9.250 + - 10.44.9.251 # your internal DNS server + - 1.1.1.1 environment: - NODE_ENV=production - LOG_LEVEL=info - EXTERNAL_URL=http://192.168.8.222:3600 - - DATABASE_HOST=host.docker.internal # if running on the same docker then do this - - DATABASE_PORT=5433 + - DATABASE_HOST=postgres # if running on the same docker then do this + - DATABASE_PORT=5432 - DATABASE_USER=${DATABASE_USER} - DATABASE_PASSWORD=${DATABASE_PASSWORD} - DATABASE_DB=${DATABASE_DB} - - PROD_SERVER=${PROD_SERVER} + - PROD_SERVER=10.75.9.56 #${PROD_SERVER} - PROD_PLANT_TOKEN=${PROD_PLANT_TOKEN} - PROD_USER=${PROD_USER} - PROD_PASSWORD=${PROD_PASSWORD} + - GP_SERVER=10.193.9.31 + - SQL_PORT= 1433 - BETTER_AUTH_SECRET=${BETTER_AUTH_SECRET} - BETTER_AUTH_URL=${URL} - # for all host including prod servers, plc's, printers, or other de -# extra_hosts: -# - "${PROD_SERVER}:${PROD_IP}" + - OPENDOCK_URL=${OPENDOCK_URL} + - OPENDOCK_PASSWORD=${OPENDOCK_PASSWORD} + - DEFAULT_DOCK=${DEFAULT_DOCK} + - DEFAULT_LOAD_TYPE=${DEFAULT_LOAD_TYPE} + - DEFAULT_CARRIER=${DEFAULT_CARRIER} -# networks: -# - default -# - logisticsNetwork -# #- mlan1 -# networks: -# logisticsNetwork: -# driver: macvlan -# driver_opts: -# parent: eth0 -# ipam: -# config: -# - subnet: ${LOGISTICS_NETWORK} -# gateway: ${LOGISTICS_GATEWAY} + #for all host including prod servers, plc's, printers, or other de + networks: + - docker-network -# mlan1: -# driver: macvlan -# driver_opts: -# parent: eth0 -# ipam: -# config: -# - subnet: ${MLAN1_NETWORK} -# gateway: ${MLAN1_GATEWAY} +networks: + docker-network: + external: true \ No newline at end of file