Skip to content

Commit a3594ae

Browse files
authored
Merge pull request #38 from sonndinh/consistent-docker-local-environments
Consolidate ports for Docker and local environments
2 parents a9cbd6c + 571d0d0 commit a3594ae

File tree

8 files changed

+21
-10
lines changed

8 files changed

+21
-10
lines changed

DockerfileFrontend-dev

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ COPY frontend frontend
44
WORKDIR frontend
55
RUN npm install
66

7-
EXPOSE 3000
7+
EXPOSE 3001
88

99
# Start the app in development mode
1010
ENTRYPOINT ["npm", "run", "dev"]

README.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ source setenv.sh
2121
cd UnityAuth
2222
./gradlew run
2323
```
24+
This starts the UnityAuth API server on http://localhost:9090 if the `MICRONAUT_ENVIRONMENTS`
25+
environment variable contains `local`.
2426

2527
Run the UnityAuth UI in another terminal windows:
2628
```shell
@@ -29,6 +31,7 @@ cd frontend
2931
npm install
3032
npm run dev
3133
```
34+
This starts the frontend on http://localhost:3001.
3235

3336
### Docker Environment
3437
To launch the auth service, you can use the docker compose from the project root:
@@ -41,7 +44,7 @@ This will start containers for the UnityAuth API, UI and database server with se
4144
names `unity-auth-api`, `unity-auth-ui`, and `unity-auth-db`, respectively.
4245

4346
- **UnityAuth API** on http://localhost:9090 (inside Docker http://unity-auth-api:9090)
44-
- **UnityAuth UI** on http://localhost:3001 (inside Docker http://unity-auth-ui:3000)
47+
- **UnityAuth UI** on http://localhost:3001 (inside Docker http://unity-auth-ui:3001)
4548
- **MySQL Database** is open on port `13306` in `localhost` (within Docker is port `3306`
4649
with host name `unity-auth-db`)
4750

@@ -72,7 +75,8 @@ This repository contains three main subprojects:
7275

7376
### 1. UnityAuth (Main Service)
7477

75-
**Location:** `/UnityAuth/`
78+
**Location:** `/UnityAuth`
79+
7680
**Technology:** Java 21 + Micronaut Framework
7781

7882
The core authentication service that provides:
@@ -94,7 +98,8 @@ The core authentication service that provides:
9498

9599
### 2. AuthGenHash (Utility Tool)
96100

97-
**Location:** `/AuthGenHash/`
101+
**Location:** `/AuthGenHash`
102+
98103
**Technology:** Java 17 + Micronaut + PicoCLI
99104

100105
A command-line utility for generating secure password hashes compatible with the UnityAuth service.
@@ -107,7 +112,8 @@ A command-line utility for generating secure password hashes compatible with the
107112

108113
### 3. Frontend (Web Administration Interface)
109114

110-
**Location:** `/frontend/`
115+
**Location:** `/frontend`
116+
111117
**Technology:** SvelteKit + TypeScript + Tailwind CSS
112118

113119
A modern web application providing administrative interface for the UnityAuth service.

UnityAuth/src/main/resources/application-docker.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ micronaut:
1818
- localhost:3000
1919
- http://127.0.0.1:3000
2020
- http://libre311-ui:3000
21+
- http://libre311-ui-dev:3000
2122
- http://localhost:3001
2223
- localhost:3001
2324
- http://127.0.0.1:3001

UnityAuth/src/main/resources/application-local.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,15 @@ micronaut:
1111
- http://localhost:3000
1212
- localhost:3000
1313
- http://127.0.0.1:3000
14+
- http://libre311-ui:3000
15+
- http://libre311-ui-dev:3000
1416
- http://localhost:3001
1517
- localhost:3001
1618
- http://127.0.0.1:3001
19+
- http://unity-auth-ui:3001
20+
- http://unity-auth-ui-dev:3001
1721
localhost-pass-through: true
18-
port: 8081
22+
port: 9090
1923
security:
2024
authentication: bearer
2125
datasources:

docker-compose.local.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ services:
3030
environment:
3131
VITE_BACKEND_URL: http://unity-auth-api:9090
3232
ports:
33-
- "3001:3000"
33+
- "3001:3001"
3434

3535
## UI Service - Production environment
3636
## Start by: docker compose -f docker-compose.local.yml --profile prod up

frontend/package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

frontend/setenv.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export VITE_BACKEND_URL=http://127.0.0.1:8081
1+
export VITE_BACKEND_URL=http://127.0.0.1:9090

frontend/vite.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export default defineConfig({
77
include: ['src/**/*.{test,spec}.{js,ts}']
88
},
99
server: {
10-
port: 3000,
10+
port: 3001,
1111
host: true
1212
}
1313
});

0 commit comments

Comments
 (0)