Skip to content

Commit

Permalink
Merge pull request #21 from georgejkaye/better-readme
Browse files Browse the repository at this point in the history
Better readme
  • Loading branch information
georgejkaye authored Jan 1, 2024
2 parents 447c2d0 + 8784c5e commit 0d1fb8f
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 5 deletions.
48 changes: 47 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,47 @@
# thesis-tracker
# thesis-tracker

## Usage

### Environment variables

You will need to set up some environment variables, which you can put in a
`.env` file in the project root if you like.

```sh
API_PORT=
CLIENT_PORT=

ADMIN_USER=

DB_HOST=
DB_USER=
DB_NAME=

POETRY_VERSION=

DEADLINE=

# prod only
API_HOST=
CLIENT_HOST=
```

### Development

```sh
# old
docker-compose -f docker-compose.dev.yml up --build

# new
docker compose -f docker-compose.dev.yml up --build
```

### Deployment

```sh
# old
docker-compose -f docker-compose.prod.yml up --build

# new
docker compose -f docker-compose.prod.yml up --build
```
6 changes: 4 additions & 2 deletions api/src/api/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@
from passlib.context import CryptContext
from pydantic import BaseModel

def read_secret(file : str) -> Optional[str]:
if os.path.isfile(file) :

def read_secret(file: str) -> Optional[str]:
if os.path.isfile(file):
with open(file) as f:
value = f.readline().replace("\n", "")
return value
raise ValueError(f"Secret file {file} does not exist")


def get_env_variable(name: str) -> str:
var = os.getenv(name)
if var:
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ services:
args:
API_URL: "http://api:${API_PORT}"
CLIENT_PORT: ${CLIENT_PORT}
DEADLINE: 2024-07-01T23:59
DEADLINE: ${DEADLINE}
ports:
- "${CLIENT_PORT}:${CLIENT_PORT}"
environment:
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ services:
args:
API_URL: "http://api:${API_PORT}"
CLIENT_PORT: ${CLIENT_PORT}
DEADLINE: 2024-07-01T23:59:59
DEADLINE: ${DEADLINE}
ports:
- "${CLIENT_PORT}:${CLIENT_PORT}"
environment:
Expand Down

0 comments on commit 0d1fb8f

Please sign in to comment.