Skip to content
Merged
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
41 changes: 41 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: CI - Argus IA

on:
push:
branches: [ "main", "develop" ]
pull_request:
branches: [ "main", "develop" ]

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout do código
uses: actions/checkout@v3

- name: Configurar Python
uses: actions/setup-python@v4
with:
python-version: "3.10"

- name: Instalar dependências
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt || true

- name: Rodar testes (opcional – se adicionar testes)
run: |
echo "Nenhum teste configurado por enquanto"
continue-on-error: true

- name: Build Docker
uses: docker/setup-buildx-action@v2

- name: Construir imagem Docker
run: |
docker build -t argusia .

- name: Verificar sucesso do build
run: |
echo "Build do Docker finalizado com sucesso!"
14 changes: 9 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
# Use uma imagem oficial do Python
FROM python:3.10-slim

# Defina o diretório de trabalho dentro do container
# Instalar dependências do sistema para psycopg2
RUN apt-get update && apt-get install -y \
gcc \
postgresql-client \
libpq-dev \
&& rm -rf /var/lib/apt/lists/*

WORKDIR /app

# Variáveis de ambiente
Expand All @@ -18,9 +23,8 @@ RUN apt-get update && apt-get install -y \
# Copie os arquivos de requirements e instale as dependências
COPY requirements.txt .
RUN pip install --upgrade pip
RUN pip install -r requirements.txt
RUN pip install --no-cache-dir -r requirements.txt

# Copie todo o projeto para dentro do container
COPY . .

# Coletar arquivos estáticos (importante para Django)
Expand All @@ -30,4 +34,4 @@ RUN python manage.py collectstatic --noinput
EXPOSE 8000

# Comando para rodar o servidor Django com Gunicorn
CMD ["gunicorn", "--bind", "0.0.0.0:8000", "argus_ia.wsgi:application"]
CMD ["gunicorn", "--bind", "0.0.0.0:8000", "argus_ia.wsgi:application"]
2 changes: 1 addition & 1 deletion argus_ia/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,4 +134,4 @@
SECURE_HSTS_PRELOAD = True

# Configuração de porta
PORT = os.environ.get('PORT', 8000)
PORT = os.environ.get('PORT', 8000)