commit 1f618e03f3c3b00d6e5a9efd18ae9d1f4d545ff7 Author: Taylor Billingsley Date: Wed Oct 14 20:20:14 2026 -0500 updates diff --git a/.github/workflows/_build-container.yaml b/.github/workflows/_build-container.yaml new file mode 100644 index 0000000..d62d95b --- /dev/null +++ b/.github/workflows/_build-container.yaml @@ -0,0 +1,24 @@ +on: + workflow_call: + inputs: + environment: + required: true + type: string + +jobs: + build: + name: Build and Push + environment: ${{ inputs.environment }} + runs-on: self-hosted + # timeout-minutes: 20 + steps: + - uses: actions/checkout@v4 + + - name: Build and push Docker image + run: | + cd ${{ vars.DOCKERFILE_DIR }} + docker login --username ${{ vars.DOCKER_USER }} --password ${{ vars.DOCKER_PASSWORD }} ${{ vars.DOCKER_REGISTRY }} + docker buildx build \ + -t ${{ vars.DOCKER_REGISTRY }}/${{ inputs.environment }}:latest \ + -t ${{ vars.DOCKER_REGISTRY }}/${{ inputs.environment }}:${{ github.run_number }} \ + --push . diff --git a/.github/workflows/_release-deploy.yaml b/.github/workflows/_release-deploy.yaml new file mode 100644 index 0000000..98adba3 --- /dev/null +++ b/.github/workflows/_release-deploy.yaml @@ -0,0 +1,33 @@ +on: + workflow_call: + inputs: + environment: + required: true + type: string + + +jobs: + deploy: + name: Release Deploy + environment: ${{ inputs.environment }} + runs-on: self-hosted + # timeout-minutes: 20 + steps: + - uses: actions/checkout@v4 + + - name: Kubernetes Deploy + run: | + # for s in $(echo $SECRETS | jq -r "to_entries|map(\"\(.key)=\(.value|tostring)\")|.[]"); do export $s; done + # for s in $(echo $VARS | jq -r "to_entries|map(\"\(.key)=\(.value|tostring)\")|.[]" ); do echo $s && export $s;done + + + for s in $(echo $SECRETS | jq -r "to_entries|map(\"\(.key)=\(.value|tostring)\")|.[]" ); do export $s;done + for s in $(echo $VARS | jq -r "to_entries|map(\"\(.key)='\(.value|tostring)'\")|.[]"); do echo $s && export $s; done + + envsubst < ${{ vars.K3S_MANIFEST }} | kubectl apply -f - + env: + K3S_DEPLOY_NAME: ${{ inputs.environment }} + K3S_NAMESPACE: ${{ vars.K3S_NAMESPACE }} + K3S_DOCKER_IMAGE: ${{ vars.DOCKER_REGISTRY }}/${{ inputs.environment }}:${{ github.run_number }} + SECRETS: ${{ toJSON(secrets) }} + VARS: ${{ toJSON(vars) }} diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e69de29 diff --git a/README.md b/README.md new file mode 100644 index 0000000..8bd6648 --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +asdf diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..e69de29 diff --git a/src/api/Dockerfile b/src/api/Dockerfile new file mode 100644 index 0000000..34d8306 --- /dev/null +++ b/src/api/Dockerfile @@ -0,0 +1,17 @@ +FROM python:3.12 + +WORKDIR /code + +COPY ./requirements/base.txt /code/requirements.txt + +RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt + +COPY ./app /code/app + +RUN useradd fastapiuser + +USER fastapiuser + +EXPOSE 8080 + +CMD ["fastapi", "run", "app/main.py", "--port", "8080"] diff --git a/src/api/__init__.py b/src/api/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/api/api-service-stg.yaml b/src/api/api-service-stg.yaml new file mode 100644 index 0000000..e69de29 diff --git a/src/api/requirements.txt b/src/api/requirements.txt new file mode 100644 index 0000000..7d2191b --- /dev/null +++ b/src/api/requirements.txt @@ -0,0 +1,5 @@ +fastapi[standard] +asyncpg +sqlalchemy[asyncio] +pydantic +pydantic-settings diff --git a/src/core/Dockerfile b/src/core/Dockerfile new file mode 100644 index 0000000..e69de29 diff --git a/src/web/Dockerfile b/src/web/Dockerfile new file mode 100644 index 0000000..e69de29