Skip to content

Commit

Permalink
swap adminer to pgadmin for backend-ms
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanprytula committed Dec 17, 2024
1 parent 2ed22ee commit 82f3ce5
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ trim_trailing_whitespace = true
insert_final_newline = true

[*.py]
max_line_length = 119
max_line_length = 80
indent_size = 2

[*.md]
Expand Down
7 changes: 7 additions & 0 deletions microservices/backend/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
__pycache__
*.pyc
.mypy_cache
.coverage
htmlcov
.cache
.venv
5 changes: 5 additions & 0 deletions microservices/backend/app/api/routes/private.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ class PrivateUserCreate(BaseModel):
is_verified: bool = False


@router.get("/")
def read_root():
return {"message": "Hello from FastAPI"}


@router.post("/users/", response_model=UserPublic)
def create_user(user_in: PrivateUserCreate, session: SessionDep) -> Any:
"""
Expand Down
13 changes: 9 additions & 4 deletions microservices/backend/compose.override.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,15 @@ services:
ports:
- "5432:5432"

adminer:
# adminer:
# restart: "no"
# ports:
# - "8080:8080"

pgadmin:
restart: "no"
ports:
- "8080:8080"
- "5050:80"

backend:
restart: "no"
Expand Down Expand Up @@ -59,5 +64,5 @@ services:
# - MAILTRAP_PASSWORD=password


volumes:
maildata:
# volumes:
# maildata:
39 changes: 34 additions & 5 deletions microservices/backend/compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,35 @@ services:
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD?Variable not set}
- POSTGRES_USER=${POSTGRES_USER?Variable not set}
- POSTGRES_DB=${POSTGRES_DB?Variable not set}
# - POSTGRES_INITDB_ARGS=${POSTGRES_INITDB_ARGS}

adminer:
image: adminer
# adminer:
# image: adminer
# restart: always
# networks:
# # - traefik-public
# - default
# depends_on:
# - db
# environment:
# - ADMINER_DESIGN=pepa-linha-dark

pgadmin:
image: dpage/pgadmin4:latest
container_name: pgadmin4_container
restart: always
networks:
# - traefik-public
- default
depends_on:
- db
db:
condition: service_healthy
restart: true
environment:
- ADMINER_DESIGN=pepa-linha-dark
- PGADMIN_DEFAULT_EMAIL=${PGADMIN_MAIL}
- PGADMIN_DEFAULT_PASSWORD=${PGADMIN_PW}
volumes:
- pgadmin-data:/var/lib/pgadmin


prestart:
# image: '${DOCKER_IMAGE_BACKEND?Variable not set}:${TAG-latest}'
Expand Down Expand Up @@ -109,5 +126,17 @@ services:
context: .
dockerfile: Dockerfile


# nginx-reverse-proxy:
# image: nginx:latest
# ports:
# - 8080:8080
# volumes:
# - ./nginx_config.conf:/etc/nginx/conf.d/default.conf
# depends_on:
# - team-service
# - pokemon-service

volumes:
app-db-data:
pgadmin-data:

0 comments on commit 82f3ce5

Please sign in to comment.