-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🍰 [v1.0.1] Integrated docker + github actions
- Loading branch information
1 parent
778f4e6
commit 86dde59
Showing
8 changed files
with
82 additions
and
2 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,14 @@ | ||
# Python related | ||
.venv/ | ||
__pycache__/ | ||
|
||
# Project-specific files | ||
.env | ||
firebase-adminsdk.json | ||
.github/ | ||
tests/ | ||
.gitignore | ||
README.md | ||
|
||
# Docker-specific files | ||
Dockerfile |
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,19 @@ | ||
name: Build Python | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Setup Python | ||
uses: actions/[email protected] | ||
with: | ||
python-version: 3.11 | ||
|
||
- name: Install dependencies | ||
run: pip install -r requirements.txt |
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,25 @@ | ||
name: Deploy to Docker Hub | ||
|
||
on: | ||
workflow_run: | ||
workflows: ["Build Python"] | ||
types: | ||
- completed | ||
|
||
jobs: | ||
deploy: | ||
if: ${{ github.event.workflow_run.conclusion == 'success' }} | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/[email protected] | ||
name: Check out code | ||
|
||
- uses: mr-smithers-excellent/docker-build-push@v6 | ||
name: Build & push Docker image | ||
with: | ||
image: areebahmeddd/mivro-backend | ||
tags: latest | ||
registry: docker.io | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} |
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,11 @@ | ||
FROM python:3.11-slim | ||
|
||
WORKDIR /mivro-backend | ||
|
||
COPY requirements.txt . | ||
|
||
RUN pip install --no-cache-dir -r requirements.txt | ||
|
||
COPY . . | ||
|
||
EXPOSE 5000 |
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,10 @@ | ||
services: | ||
app: | ||
build: . | ||
container_name: mivro_container | ||
command: python server/app.py | ||
ports: | ||
- 5000:5000 | ||
volumes: | ||
- .:/mivro-backend | ||
restart: always |
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
Empty file.