Skip to content

Commit 23cece4

Browse files
committed
feat: Update Dockerfile to create a non-root user and switch to it; modify config.js to enable service-specific base URLs for local development
1 parent 7ea40bf commit 23cece4

2 files changed

Lines changed: 32 additions & 28 deletions

File tree

Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ RUN npm install && npm run build
2828
# Port configuration
2929
EXPOSE 9090 9091 9092 9093 9094 80
3030

31+
# Create a non-root user and switch to it
32+
RUN useradd -u 10014 -m resourcehub
33+
USER resourcehub
34+
3135
# Prepare the final image
3236
WORKDIR /app
3337
CMD ["sh", "-c", "java -jar /app/Back-End/target/bin/ResourceHub.jar & npx serve -s /app/Front-End/build -l 80"]

Front-End/src/services/api/config.js

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -4,34 +4,34 @@ const BASE_URL =
44

55
// Service-specific base URLs
66
export const BASE_URLS = {
7-
login: `${BASE_URL}/auth-380/v1.0`,
8-
maintenance: `${BASE_URL}/maintenance-f9f/v1.0`,
9-
asset: `${BASE_URL}/v1.0`,
10-
user: `${BASE_URL}/user-294/v1.0`,
11-
assetRequest: `${BASE_URL}/assetrequest-9fc/v1.0`,
12-
calendar: `${BASE_URL}/calendar-eb2/v1.0`,
13-
mealtime: `${BASE_URL}/mealtime-481/v1.0`,
14-
mealtype: `${BASE_URL}/mealtype-899/v1.0`,
15-
settings: `${BASE_URL}/settings-e6f/v1.0`,
16-
dashboardAdmin: `${BASE_URL}/dashboard-admin-f7e/v1.0`,
17-
dashboardUser: `${BASE_URL}/dashboard-user-bda/v1.0`,
18-
orgsettings: `${BASE_URL}/orgsettings-433/v1.0`,
19-
report: `${BASE_URL}/schedulereports-a9e/v1.0`,
20-
notification: `${BASE_URL}/notification-ad2/v1.0`,
7+
// login: `${BASE_URL}/auth-380/v1.0`,
8+
// maintenance: `${BASE_URL}/maintenance-f9f/v1.0`,
9+
// asset: `${BASE_URL}/v1.0`,
10+
// user: `${BASE_URL}/user-294/v1.0`,
11+
// assetRequest: `${BASE_URL}/assetrequest-9fc/v1.0`,
12+
// calendar: `${BASE_URL}/calendar-eb2/v1.0`,
13+
// mealtime: `${BASE_URL}/mealtime-481/v1.0`,
14+
// mealtype: `${BASE_URL}/mealtype-899/v1.0`,
15+
// settings: `${BASE_URL}/settings-e6f/v1.0`,
16+
// dashboardAdmin: `${BASE_URL}/dashboard-admin-f7e/v1.0`,
17+
// dashboardUser: `${BASE_URL}/dashboard-user-bda/v1.0`,
18+
// orgsettings: `${BASE_URL}/orgsettings-433/v1.0`,
19+
// report: `${BASE_URL}/schedulereports-a9e/v1.0`,
20+
// notification: `${BASE_URL}/notification-ad2/v1.0`,
2121

2222
// For local development
23-
// login: "http://localhost:9094/auth",
24-
// maintenance: "http://localhost:9090/maintenance",
25-
// asset: "http://localhost:9090/asset",
26-
// user: "http://localhost:9090/user",
27-
// assetRequest: "http://localhost:9090/assetrequest",
28-
// calendar: "http://localhost:9090/calendar",
29-
// mealtime: "http://localhost:9090/mealtime",
30-
// mealtype: "http://localhost:9090/mealtype",
31-
// settings: "http://localhost:9090/settings",
32-
// dashboardAdmin: "http://localhost:9092/dashboard/admin",
33-
// dashboardUser: "http://localhost:9092/dashboard/user",
34-
// orgsettings: "http://localhost:9090/orgsettings",
35-
// report: "http://localhost:9090/schedulereports",
36-
// notification: "http://localhost:9093/notification",
23+
login: "http://localhost:9094/auth",
24+
maintenance: "http://localhost:9090/maintenance",
25+
asset: "http://localhost:9090/asset",
26+
user: "http://localhost:9090/user",
27+
assetRequest: "http://localhost:9090/assetrequest",
28+
calendar: "http://localhost:9090/calendar",
29+
mealtime: "http://localhost:9090/mealtime",
30+
mealtype: "http://localhost:9090/mealtype",
31+
settings: "http://localhost:9090/settings",
32+
dashboardAdmin: "http://localhost:9092/dashboard/admin",
33+
dashboardUser: "http://localhost:9092/dashboard/user",
34+
orgsettings: "http://localhost:9090/orgsettings",
35+
report: "http://localhost:9090/schedulereports",
36+
notification: "http://localhost:9093/notification",
3737
};

0 commit comments

Comments
 (0)