Skip to content

Commit

Permalink
chore: setup ports for gestao db
Browse files Browse the repository at this point in the history
  • Loading branch information
Matheusafonsouza committed Oct 19, 2023
1 parent 0f5ee1c commit eb0c703
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ jobs:
pytest:
runs-on: ubuntu-latest
services:

gestao-db:
image: postgres:13.8-bullseye
env:
Expand All @@ -61,7 +60,7 @@ jobs:
--health-timeout=5s
--health-retries=5
ports:
- 5432:5432
- 5433:5432
steps:
- uses: actions/checkout@v2
- name: Set up Python
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ For running tests on your local machine.

I prefer doing it with docker:
```
docker run -p "5432:5432" -e "POSTGRES_PASSWORD=gestao" -e "POSTGRES_USER=gestao" -e "POSTGRES_DB=gestao" postgres:13.8-bullseye
docker run -p "5433:5432" -e "POSTGRES_PASSWORD=gestao" -e "POSTGRES_USER=gestao" -e "POSTGRES_DB=gestao" postgres:13.8-bullseye
```


Expand Down
8 changes: 5 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ services:
context: .
dockerfile: Dockerfile
ports:
- "8000:8000"
- "8001:8000"
volumes:
- .:/app/src/
restart: always
Expand All @@ -17,7 +17,7 @@ services:
environment:
GESTAO_HOST: 0.0.0.0
GESTAO_DB_HOST: gestao-db
GESTAO_DB_PORT: 5432
GESTAO_DB_PORT: 5433
GESTAO_DB_USER: gestao
GESTAO_DB_PASS: gestao
GESTAO_DB_BASE: gestao
Expand All @@ -26,6 +26,8 @@ services:
db:
image: postgres
hostname: gestao-db
ports:
- "5433:5432"
environment:
POSTGRES_PASSWORD: "gestao"
POSTGRES_USER: "gestao"
Expand All @@ -47,7 +49,7 @@ services:
command: alembic upgrade head
environment:
GESTAO_DB_HOST: gestao-db
GESTAO_DB_PORT: 5432
GESTAO_DB_PORT: 5433
GESTAO_DB_USER: gestao
GESTAO_DB_PASS: gestao
GESTAO_DB_BASE: gestao
Expand Down
2 changes: 1 addition & 1 deletion gestao/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class Settings(BaseSettings):
log_level: LogLevel = LogLevel.INFO
# Variables for the database
db_host: str = "localhost"
db_port: int = 5432
db_port: int = 5433
db_user: str = "gestao"
db_pass: str = "gestao"
db_base: str = "gestao"
Expand Down

0 comments on commit eb0c703

Please sign in to comment.