Skip to content

Commit

Permalink
Fix ci, rfs #273
Browse files Browse the repository at this point in the history
  • Loading branch information
rednafi committed Oct 21, 2023
1 parent f862757 commit e343609
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Host and port.
HOST="0.0.0.0" # localhost
PORT="5002" # port to access the app
PYTHON_VERSION="39" # which dockerfile to use. see in dockerfiles/python*/Dockerfile
PYTHON_VERSION="312" # which dockerfile to use. see in dockerfiles/python*/Dockerfile

# App config.

Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,18 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v3

- name: Spin up container
run: |
sed -i "s/PYTHON_VERSION=.*/PYTHON_VERSION=${{ matrix.python-version }}/" '.env'
sed -i 's/PORT=.*/PORT=5002/' '.env'
echo "Building container for Python $PYTHON_VERSION."
echo "Building container for Python ${{ matrix.python-version }}."
cat
docker compose up -d
- name: Wait and check the health of the container
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
path: ~/Library/Caches/pip

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
Expand Down
7 changes: 7 additions & 0 deletions app/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import logging
import sys

# Set default logging value to debug
logging.basicConfig(level=logging.INFO)

logging.info("Running fastapi-nano with Python %s", sys.version)
2 changes: 1 addition & 1 deletion makefile
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,4 @@ kill-container: ## Stop the running docker container.

.PHONY: run-local
run-local: ## Run the app locally.
uvicorn app.main:app --port 5000 --reload
uvicorn app.main:app --port 5002 --reload

0 comments on commit e343609

Please sign in to comment.