diff --git a/apps/frontend/README.md b/apps/frontend/README.md index 1ecb949..d028fcf 100644 --- a/apps/frontend/README.md +++ b/apps/frontend/README.md @@ -18,4 +18,10 @@ yarn dev ### Development Dependencies -This package depends on the local packages `@mancala/core` and `mancala.js`. Refer to their documentation for further instructions. \ No newline at end of file +This package depends on the local packages `@mancala/core` and `mancala.js`. Refer to their documentation for further instructions. + +### Docker Build + +```bash +docker build --build-arg SERVER_ADDRESS=http://localhost:5000 --build-arg WS_SERVER_ADDRESS=http://localhost:5000 -t mancala-frontend . +``` \ No newline at end of file diff --git a/apps/frontend/src/const/config.ts b/apps/frontend/src/const/config.ts index e786b15..f19c749 100644 --- a/apps/frontend/src/const/config.ts +++ b/apps/frontend/src/const/config.ts @@ -5,13 +5,14 @@ export type Server = { wsServerAdress: string; }; -export const LOCAL_PORT='localhost:5005'; +export const LOCAL_SERVER_ADDRESS='http://localhost:5005'; +export const LOCAL_WS_SERVER_ADDRESS='http://localhost:5005'; export const server: Server = { //@ts-ignore - serverAdress: process.env.SERVER_ADDRESS ? `https://${process.env.SERVER_ADDRESS}` : 'http://' + LOCAL_PORT, + serverAdress: process.env.SERVER_ADDRESS ? `${process.env.SERVER_ADDRESS}` : LOCAL_PORT, //@ts-ignore - wsServerAdress: process.env.SERVER_ADDRESS ? `wss://${process.env.SERVER_ADDRESS}` : 'ws://' + LOCAL_PORT, + wsServerAdress: process.env.WS_SERVER_ADDRESS ? `${process.env.WS_SERVER_ADDRESS}` : LOCAL_WS_SERVER_ADDRESS, } export const RTMT_WS_PING_INTERVAL = 1000, RTMT_WS_PING_INTERVAL_BUFFER_TIME = 2000; \ No newline at end of file