diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f559341..ba97685 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -123,7 +123,7 @@ jobs: type=semver,pattern={{version}},value=${{ github.ref == 'refs/heads/main' && env.VERSION || format('{0}-{1}', env.VERSION, github.ref_name) }} images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} labels: | - org.opencontainers.image.description=Slick Telemetry backend ${{ env.BUILD_NAME }} image + org.opencontainers.image.description=Slick Telemetry rearwing ${{ env.BUILD_NAME }} image org.opencontainers.image.version=${{ env.VERSION }} # Build and upload Docker image to GHCR with Buildx diff --git a/README.md b/README.md index 2fe8f98..7e988d2 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -[![CodeQL](https://github.com/Slick-Telemetry/backend/actions/workflows/codeql.yml/badge.svg?branch=main)](https://github.com/Slick-Telemetry/backend/actions/workflows/codeql.yml) +[![CodeQL](https://github.com/Slick-Telemetry/rearwing/actions/workflows/codeql.yml/badge.svg?branch=main)](https://github.com/Slick-Telemetry/rearwing/actions/workflows/codeql.yml) -# backend +# rearwing Slick Telemetry backend written in python with fastf1. @@ -111,11 +111,11 @@ In `/docker`, create a copy of `.env.example` as `.env`. - Build image ```sh - docker build --file Dockerfile.dev --tag backend-dev . + docker build --file Dockerfile.dev --tag rearwing-dev . ``` - Run container ```sh - docker run --name backend-dev --publish 8081:8081 backend-dev --detach + docker run --name rearwing-dev --publish 8081:8081 rearwing-dev --detach ``` - Open your browser at [`http://localhost:8081`](http://localhost:8081). diff --git a/app/__init__.py b/app/__init__.py index fa9ea19..d063f8f 100644 --- a/app/__init__.py +++ b/app/__init__.py @@ -1,13 +1,3 @@ -import newrelic.agent # isort:skip - - -# Built-in -import os - - -if os.getenv("ENVIRONMENT") != "TEST": - newrelic.agent.initialize("newrelic.ini") - # External import fastf1 from dotenv import dotenv_values diff --git a/app/main.py b/app/main.py index 5c8e511..25a08c3 100644 --- a/app/main.py +++ b/app/main.py @@ -1,6 +1,14 @@ import newrelic.agent # isort:skip +# Built-in +import os + + +if os.getenv("ENVIRONMENT") != "TEST": + newrelic.agent.initialize("newrelic.ini") + + # Built-in import json from datetime import datetime diff --git a/docker/compose.dev.yaml b/docker/compose.dev.yaml index fe2995a..140b7d5 100644 --- a/docker/compose.dev.yaml +++ b/docker/compose.dev.yaml @@ -4,7 +4,7 @@ include: - supabase-selfhost.yaml services: app: - container_name: backend-dev + container_name: rearwing-dev build: context: .. dockerfile: Dockerfile.dev diff --git a/process.config.js b/process.config.js index 74a4b75..44fd91b 100644 --- a/process.config.js +++ b/process.config.js @@ -1,7 +1,7 @@ module.exports = { apps: [ { - name: "slick_telemetry_backend", + name: "slick_telemetry_rearwing", script: "uvicorn", interpreter: "./.venv/bin/python", args: "app.main:app --host 0.0.0.0 --port 8081", diff --git a/pyproject.toml b/pyproject.toml index 367900b..ca67634 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,7 @@ build-backend = "poetry.core.masonry.api" #-->> Metadata <<------------------------------------------ [tool.poetry] -name = "backend" +name = "rearwing" version = "0.6.0" description = "Slick Telemetry backend written in python with fastapi" authors = ["Slick Telemetry "] diff --git a/useful_commands.md b/useful_commands.md index ffcee7d..a9c6dda 100644 --- a/useful_commands.md +++ b/useful_commands.md @@ -74,29 +74,29 @@ docker ps #### Build the images ```sh -docker build --file Dockerfile.dev --tag backend-dev . -docker build --file Dockerfile.prod --tag backend-prod . +docker build --file Dockerfile.dev --tag rearwing-dev . +docker build --file Dockerfile.prod --tag rearwing-prod . ``` #### Start the containers ```sh -docker run --name backend-dev --publish 8081:8081 backend-dev --detach -docker run --name backend-prod --publish 80:80 backend-prod --detach +docker run --name rearwing-dev --publish 8081:8081 rearwing-dev --detach +docker run --name rearwing-prod --publish 80:80 rearwing-prod --detach ``` #### Stop the containers ```sh -docker stop backend-dev -docker stop backend-prod +docker stop rearwing-dev +docker stop rearwing-prod ``` #### Restart the containers ```sh -docker restart backend-dev -docker restart backend-prod +docker restart rearwing-dev +docker restart rearwing-prod ``` ### Compose