Skip to content

Commit e7fb1ac

Browse files
Merge pull request #4 from RafaelGermano05/develop
Develop
2 parents d9cfc1b + 2002d0f commit e7fb1ac

File tree

3 files changed

+51
-6
lines changed

3 files changed

+51
-6
lines changed

.github/workflows/ci.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
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!"

Dockerfile

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
1-
# Use uma imagem oficial do Python
21
FROM 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+
510
WORKDIR /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
1924
COPY requirements.txt .
2025
RUN 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
2428
COPY . .
2529

2630
# Coletar arquivos estáticos (importante para Django)
@@ -30,4 +34,4 @@ RUN python manage.py collectstatic --noinput
3034
EXPOSE 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"]

argus_ia/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,4 +134,4 @@
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)

0 commit comments

Comments
 (0)