Skip to content

Commit

Permalink
small changes
Browse files Browse the repository at this point in the history
add restart always, fix example.env and update readme.md, use docker compose not docker-compose
  • Loading branch information
burturt committed Jun 3, 2024
1 parent 3ff1e6f commit 5b700d7
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 2 deletions.
6 changes: 5 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
JWT_TOKEN=jwt_secret_string_here
JWT_TOKEN=
POSTGRES_USER=
POSTGRES_PASSWORD=
POSTGRES_DB=
ADMIN_PASSWORD=
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ A mini pop quiz game for CS 33, originally created by https://github.com/eado fo

## Setup

Make a copy of `.env.example` into `.env.`. Set a value for each:

- `JWT_TOKEN` should be some very long random secret string.
- `POSTGRES_*` self explanatory, just pick something
- `ADMIN_PASSWORD` password needed to login to the host instance. User password is just `desk`

### One game

Run `docker compose up`. Players connect to ports 2222 via ssh, and the game host connects to port 2223 and can see the website at port 8080.
Expand Down
3 changes: 3 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
services:
db:
image: postgres:latest
restart: always
env_file:
- .env
environment:
Expand All @@ -12,6 +13,7 @@ services:
build:
context: .
dockerfile: player/Dockerfile
restart: always
env_file:
- .env
environment:
Expand All @@ -21,6 +23,7 @@ services:
depends_on:
- db
server:
restart: always
build:
context: .
dockerfile: progress/Dockerfile
Expand Down
2 changes: 1 addition & 1 deletion start.bash
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ for i in $(seq 1 $n); do
export SERVER_HTTP_PORT=2${suffix}1
export PLAYER_PORT=2${suffix}0
export INSTANCE_NUM=$suffix
docker-compose -p ${suffix} up --build -d
docker compose -p ${suffix} up --build -d
done

echo Done! Each game instance is started at port 2XXY, where XX is the 2-digit game instance number starting at 01, and Y is 0 for player ssh join, 1 for http web server, and 2 for host ssh join.

0 comments on commit 5b700d7

Please sign in to comment.