Skip to content

Commit

Permalink
Default lobby port to 3000, simplifies downstream config
Browse files Browse the repository at this point in the history
  • Loading branch information
DanVanAtta committed Jul 23, 2024
1 parent 725aafc commit d423944
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 11 deletions.
18 changes: 11 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,22 +37,20 @@ Building from source and running locally:

```
./gradlew shadowJar
docker compose up
(TODO: add env variable so we can do something like: `LOBBY_PORT=8080 docker compose up`)
./docker-compose-up.sh
```

After the compose up, a database will be started, flyway migrations on the local
development environment will be run against that database. Finally, the lobby server
application is started and will use that same database.
After the compose up, lobby will be running on port 3000, database will be started
as well and latests flyway migrations run.


### Checking running environment

```
$ docker container ls
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
2eb8f441511f lobby-server-lobby "/bin/sh -c 'java -j…" 5 days ago Up 9 seconds 0.0.0.0:32769->8080/tcp, :::32769->8080/tcp lobby-server-lobby-1
2eb8f441511f lobby-server-lobby "/bin/sh -c 'java -j…" 5 days ago Up 9 seconds :::3000->8080/tcp, :::32769->8080/tcp lobby-server-lobby-1
a395fabccd4e postgres:10 "docker-entrypoint.s…" 5 days ago Up 9 seconds (healthy) 0.0.0.0:5432->5432/tcp, :::5432->5432/tcp lobby-server-database-1
```

Expand All @@ -63,6 +61,12 @@ a395fabccd4e postgres:10 "docker-entrypoint.s…" 5 days ago Up 9
docker exec -it --user postgres lobby-server-database-1 psql
```

### Rebuild from clean

```
docker compose rm -f
./docker-compose-up.sh
```

## Running (prod environment with docker)

Expand Down
3 changes: 3 additions & 0 deletions docker-compose-up.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash
LOBBY_PORT=3000 docker compose up

8 changes: 4 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ services:
command: >
-locations=filesystem:/flyway/sql
-connectRetries=60
-user=lobby_flyway
-password=lobby_flyway
-user=lobby_user
-password=lobby_user
-url=jdbc:postgresql://database:5432/lobby_db
migrate
volumes:
Expand All @@ -41,10 +41,10 @@ services:
dockerfile: Dockerfile
environment:
- DATABASE_USER=lobby_user
- DATABASE_PASSWORD=lobby
- DATABASE_PASSWORD=lobby_user
- DB_URL=database:5432/lobby_db
ports:
- "8080"
- "${LOBBY_PORT}:8080"
depends_on:
- flyway
#
Expand Down

0 comments on commit d423944

Please sign in to comment.