diff --git a/.env b/.env index 77e36af..cc93e36 100644 --- a/.env +++ b/.env @@ -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 \ No newline at end of file diff --git a/.env.example b/.env.example deleted file mode 100644 index 88fac8a..0000000 --- a/.env.example +++ /dev/null @@ -1,21 +0,0 @@ -APP_PORT=8000 -APP_HOST=0.0.0.0 - -# Database -POSTGRES_HOST=postgres -POSTGRES_PORT=5432 -POSTGRES_USER=postgres -POSTGRES_PASSWORD=postgres -POSTGRES_DB=database - -# Filestorage -S3_HOST=s3 -S3_BUCKETS=bucket -GATEWAY_LISTEN=4566 -SERVICES=s3 -AWS_ACCESS_KEY_ID=ACCESS -AWS_SECRET_ACCESS_KEY=SECRET - -# Cache -REDIS_HOST=redis -REDIS_PORT=6379 diff --git a/README.md b/README.md index 9ac8945..2df6db0 100644 --- a/README.md +++ b/README.md @@ -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 ``` diff --git a/docker-compose.yaml b/docker-compose.yaml index 3662bdf..36e1394 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -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: diff --git a/src/settings.py b/src/settings.py index da7fb20..2bb5c6c 100644 --- a/src/settings.py +++ b/src/settings.py @@ -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