Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: CI on Pull Request

on:
pull_request: # Задаваме trigger-а
branches:
- main
paths: # Kои файлове trigger-ват workflow-а
- 'app/**/*.py' # само .py файлове в app/
- '.github/workflows/**' # или при промяна на workflow файловете

jobs:
test:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Print a message
run: echo "Hello! This workflow runs on every pull request to main"

- name: Run tests
run: echo "This runs only if Python files were changed in app/ folder"
29 changes: 29 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Използваме Ubuntu 22.04 като база
FROM ubuntu:22.04

# Обновяваме системата и инсталираме Python + pip
RUN apt-get update && \
apt-get install -y python3 python3-pip && \
rm -rf /var/lib/apt/lists/*

# Задаваме работна директория
WORKDIR /app

# Копираме файла с зависимостите
COPY requirements.txt .

# Инсталираме зависимостите
RUN pip install --no-cache-dir -r requirements.txt

# Копираме останалия код
COPY . .

# Създаваме non-root потребител
RUN useradd -ms /bin/bash myuser
USER myuser

# Експонираме порт 5000
EXPOSE 5000

# Стартираме приложението
CMD ["python3", "app/app.py"]