Skip to content

Commit

Permalink
feat: remove .env example, upgrade readme
Browse files Browse the repository at this point in the history
  • Loading branch information
neZorinEgor committed Feb 23, 2025
1 parent 0756d98 commit e61d583
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 40 deletions.
9 changes: 6 additions & 3 deletions .env
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
APP_PORT=8000
APP_HOST=0.0.0.0
# Database
POSTGRES_HOST=postgres
POSTGRES_HOST=0.0.0.0

POSTGRES_PORT=5432
POSTGRES_USER=postgres
POSTGRES_PASSWORD=postgres
POSTGRES_DB=database

# Filestorage
S3_HOST=s3
S3_HOST=0.0.0.0
S3_BUCKETS=bucket
GATEWAY_LISTEN=4566
SERVICES=s3
AWS_ACCESS_KEY_ID=ACCESS
AWS_SECRET_ACCESS_KEY=SECRET

# Cache
REDIS_HOST=redis
REDIS_HOST=0.0.0.0
REDIS_PORT=6379
21 changes: 0 additions & 21 deletions .env.example

This file was deleted.

3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,9 @@ app = FastAPI(lifespan=lifespan)
async def index():
return dict(hello="world")
```
5. Start up application:
5. Local dev start up:
```bash
docker compose up
alembic upgrade head; uvicorn src.main:app --reload --host 0.0.0.0 --port 8000
```

25 changes: 11 additions & 14 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,24 +39,21 @@ services:
- localstack-data:/var/lib/localstack
env_file:
- .env

# backend:
# container_name: backend
# env_file:
# - .env
# ports:
# - ${APP_PORT}:${APP_PORT}
# command: bash -c "alembic upgrade head && uvicorn src.main:app --host ${APP_HOST} --port ${APP_PORT}"
# build:
# context: .
# dockerfile: Dockerfile
# depends_on:
# postgres:
# condition: service_healthy

backend:
container_name: backend
env_file:
- .env
ports:
- ${APP_PORT}:${APP_PORT}
command: bash -c "alembic upgrade head && uvicorn src.main:app --host ${APP_HOST} --port ${APP_PORT}"
build:
context: .
dockerfile: Dockerfile
depends_on:
postgres:
condition: service_healthy

volumes:
localstack-data:

Expand Down
2 changes: 1 addition & 1 deletion src/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def s3_endpoint_url(self) -> str:
def redis_url(self) -> str:
return f"redis://{self.REDIS_HOST}:{self.REDIS_PORT}"

model_config = SettingsConfigDict(env_file=".env.example")
model_config = SettingsConfigDict(env_file=".env")


settings = Settings() # noqa

0 comments on commit e61d583

Please sign in to comment.