Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
OscarDeBrito committed Aug 1, 2024
2 parents 4d11a09 + 4e28734 commit ccd3175
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 12 deletions.
16 changes: 5 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ SIGE IE
## Fase
Release 1 ✔️ <a href="https://github.com/ResidenciaTICBrisa/T2G3-Sistema-Instalacao-Eletrica/milestone/1">Ir para milestone da release 1</a>

Release 2 ✔️<a href="https://github.com/ResidenciaTICBrisa/T2G3-Sistema-Instalacao-Eletrica/milestone/2">Ir para milestone da release 2</a>
Release 2 ✔️ <a href="https://github.com/ResidenciaTICBrisa/T2G3-Sistema-Instalacao-Eletrica/milestone/2">Ir para milestone da release 2</a>

Release 3 (atual) <a href="https://github.com/ResidenciaTICBrisa/T2G3-Sistema-Instalacao-Eletrica/milestone/3">Ir para milestone da release 3</a>
## Visão geral do produto
Expand Down Expand Up @@ -172,13 +172,13 @@ Vá para dentro da pasta raiz `api`:
pip install -r requirements.txt
```
3. Inicie o Docker, depois vá para o diretório `api/sigeie` e crie a imagem do banco de dados pela primeira vez:
3. Inicie o Docker, depois vá para o diretório `api` e crie a imagem do banco de dados e da api pela primeira vez:
```
docker-compose up -d
docker-compose up --build
```
4. Ainda no mesmo terminal, retorne para o diretório raiz `api` e aplique as migrações:
4. Em outro terminal, retorne para o diretório raiz `api` e aplique as migrações:
```
python manage.py makemigrations
Expand All @@ -188,12 +188,6 @@ Vá para dentro da pasta raiz `api`:
python manage.py migrate
```
5. Inicie o servidor:
```
python manage.py runserver
```
Pronto, o servidor já está rodando com o banco de dados configurado.
##### Pela segunda vez
Expand All @@ -210,7 +204,7 @@ Garanta que não haja nenhum processo que use o porto 8080, 3306 e 6379. Por fim
- Atualizar as dependências, fazer as migrações e iniciar o servidor:
```
source venv/bin/activate && pip install -r requirements.txt && python manage.py makemigrations && python manage.py migrate && python manage.py runserver
source venv/bin/activate && python manage.py makemigrations && python manage.py migrate
```
Isso é tudo, pessoal.
Expand Down
1 change: 1 addition & 0 deletions api/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
data/mysql/db
11 changes: 11 additions & 0 deletions api/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM python:3.11

WORKDIR /app

COPY requirements.txt /app/

RUN pip install --no-cache-dir -r requirements.txt

COPY . /app/

EXPOSE 8000
12 changes: 12 additions & 0 deletions api/sigeie/docker-compose.yml → api/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,15 @@ services:
container_name: sigeie_redis_db
ports:
- "6379:6379"
web:
build: .
restart: always
container_name: sigeie_web
command: ["python", "manage.py", "runserver", "0.0.0.0:8000"]
volumes:
- .:/app
ports:
- "8000:8000"
depends_on:
- db
- redis
2 changes: 1 addition & 1 deletion api/sigeie/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'HOST': '127.0.0.1',
'HOST': 'db',
'PORT': '3306',
'USER': 'root',
'PASSWORD': 'root',
Expand Down

0 comments on commit ccd3175

Please sign in to comment.