Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
echo "IMAGE_TAG_LATEST=${DOCKER_REGISTRY_URL}/${DOCKER_REGISTRY_BUCKET}/${DOCKER_IMAGE_NAME}:latest" >> $GITHUB_ENV
- name: Build docker image
run: |
docker build . --tag $IMAGE_NAME
docker build . --build-arg APP_VERSION=$RELEASE_VERSION --tag $IMAGE_NAME
- name: Tag the image
run: |
docker tag $IMAGE_NAME $IMAGE_TAG_RELEASE
Expand Down
4 changes: 4 additions & 0 deletions app/config/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ class Settings(BaseSettings):
default="",
json_schema_extra={"env": "APP_DESCRIPTION"},
)
app_version: str = Field(
default="development",
json_schema_extra={"env": "APP_VERSION"},
)
env: str = Field(default="development", json_schema_extra={"env": "APP_ENV"})

cors_allowed_origins: str = Field(
Expand Down
2 changes: 1 addition & 1 deletion app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
app = FastAPI(
title=settings.app_name,
description=settings.app_description,
version="1.0.0",
version=settings.app_version,
)

app.add_middleware(
Expand Down
3 changes: 3 additions & 0 deletions dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Use official Python slim image
FROM python:3.11-slim

ARG APP_VERSION=development

WORKDIR /app

# system deps
Expand All @@ -17,5 +19,6 @@ COPY . .
EXPOSE 8000

ENV WORKERS=3
ENV APP_VERSION=${APP_VERSION}

CMD ["sh", "-c", "uvicorn app.main:app --host 0.0.0.0 --port 8000 --proxy-headers --workers ${WORKERS}"]
1 change: 1 addition & 0 deletions env.example
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# App
APP_NAME=
APP_DESCRIPTION=
APP_VERSION=
APP_ENV=

# CORS
Expand Down
Loading