File tree Expand file tree Collapse file tree 3 files changed +51
-6
lines changed
Expand file tree Collapse file tree 3 files changed +51
-6
lines changed Original file line number Diff line number Diff line change 1+ name : CI - Argus IA
2+
3+ on :
4+ push :
5+ branches : [ "main", "develop" ]
6+ pull_request :
7+ branches : [ "main", "develop" ]
8+
9+ jobs :
10+ build :
11+ runs-on : ubuntu-latest
12+
13+ steps :
14+ - name : Checkout do código
15+ uses : actions/checkout@v3
16+
17+ - name : Configurar Python
18+ uses : actions/setup-python@v4
19+ with :
20+ python-version : " 3.10"
21+
22+ - name : Instalar dependências
23+ run : |
24+ python -m pip install --upgrade pip
25+ pip install -r requirements.txt || true
26+
27+ - name : Rodar testes (opcional – se adicionar testes)
28+ run : |
29+ echo "Nenhum teste configurado por enquanto"
30+ continue-on-error : true
31+
32+ - name : Build Docker
33+ uses : docker/setup-buildx-action@v2
34+
35+ - name : Construir imagem Docker
36+ run : |
37+ docker build -t argusia .
38+
39+ - name : Verificar sucesso do build
40+ run : |
41+ echo "Build do Docker finalizado com sucesso!"
Original file line number Diff line number Diff line change 1- # Use uma imagem oficial do Python
21FROM python:3.10-slim
32
4- # Defina o diretório de trabalho dentro do container
3+ # Instalar dependências do sistema para psycopg2
4+ RUN apt-get update && apt-get install -y \
5+ gcc \
6+ postgresql-client \
7+ libpq-dev \
8+ && rm -rf /var/lib/apt/lists/*
9+
510WORKDIR /app
611
712# Variáveis de ambiente
@@ -18,9 +23,8 @@ RUN apt-get update && apt-get install -y \
1823# Copie os arquivos de requirements e instale as dependências
1924COPY requirements.txt .
2025RUN pip install --upgrade pip
21- RUN pip install -r requirements.txt
26+ RUN pip install --no-cache-dir - r requirements.txt
2227
23- # Copie todo o projeto para dentro do container
2428COPY . .
2529
2630# Coletar arquivos estáticos (importante para Django)
@@ -30,4 +34,4 @@ RUN python manage.py collectstatic --noinput
3034EXPOSE 8000
3135
3236# Comando para rodar o servidor Django com Gunicorn
33- CMD ["gunicorn" , "--bind" , "0.0.0.0:8000" , "argus_ia.wsgi:application" ]
37+ CMD ["gunicorn" , "--bind" , "0.0.0.0:8000" , "argus_ia.wsgi:application" ]
Original file line number Diff line number Diff line change 134134 SECURE_HSTS_PRELOAD = True
135135
136136# Configuração de porta
137- PORT = os .environ .get ('PORT' , 8000 )
137+ PORT = os .environ .get ('PORT' , 8000 )
You can’t perform that action at this time.
0 commit comments