-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add new CORS origin * add dockerfile for API * add api * rename api container * add backend-api * add backend-api docker build workflow
- Loading branch information
Showing
5 changed files
with
80 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: Build and publish backend API docker image | ||
|
||
on: | ||
[workflow_dispatch] | ||
|
||
jobs: | ||
publish_image: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
steps: | ||
- name: checkout | ||
uses: actions/checkout@v4 | ||
- name: lowercase the repository name | ||
run: | | ||
echo "REPO=${GITHUB_REPOSITORY@L}" >> "${GITHUB_ENV}" | ||
- name: login | ||
run: | | ||
echo ${{ secrets.GITHUB_TOKEN}} | docker login --username ${{ github.actor }} --password-stdin ghcr.io | ||
- name: build | ||
run: | | ||
cd air-quality-backend | ||
docker build . -t ghcr.io/${REPO}/vairify-backend-api:latest -f Dockerfile.api | ||
- name: publish | ||
run: | | ||
docker push ghcr.io/${REPO}/vairify-backend-api:latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
FROM continuumio/miniconda3 | ||
|
||
WORKDIR /usr/src/app | ||
COPY conda/environment.yml . | ||
RUN conda env create -f environment.yml | ||
|
||
SHELL ["conda", "run", "-n", "air-quality-backend", "/bin/bash", "-c"] | ||
|
||
COPY pyproject.toml . | ||
RUN poetry install | ||
|
||
COPY src/ ./src | ||
COPY README.md logging.ini ./ | ||
|
||
RUN poetry install | ||
|
||
ENTRYPOINT ["conda", "run", "--no-capture-output", "-n", "air-quality-backend", "fastapi", "run", "./src/air_quality/api/main.py"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ | |
|
||
origins = [ | ||
"http://localhost:5173", | ||
"http://127.0.0.1:5173", | ||
] | ||
|
||
load_dotenv() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters