refactor(sql): changed sql connection to ip:port
All checks were successful
Build and Push LST Docker Image / docker (push) Successful in 1m42s

this change was needed for when we run in docker so we can connect to the servers
This commit is contained in:
2026-04-22 05:40:38 -05:00
parent 7962463927
commit a6d53f0266
3 changed files with 35 additions and 34 deletions

View File

@@ -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,

View File

@@ -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: {

View File

@@ -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