Skip to content

Commit e32247d

Browse files
committed
refactor: reorganiza estrutura de volumes Docker
- Adiciona scielo_xml_tools.yml com novos caminhos de volume - Move volumes para estrutura ../markup_data/ - Corrige nomes de containers no Makefile (markapi_local_*) - Adiciona .ipython/ ao .dockerignore - Adiciona huggingface-hub ao requirements/local.txt - Atualiza .gitignore para ignorar backups e arquivos temporários
1 parent f218c87 commit e32247d

File tree

5 files changed

+104
-7
lines changed

5 files changed

+104
-7
lines changed

.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,4 @@ wheels/
3737
*.egg-info/
3838
.installed.cfg
3939
*.egg
40+
.ipython/

.gitignore

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,4 +173,20 @@ cython_debug/
173173

174174
# End of https://www.toptal.com/developers/gitignore/api/django
175175

176-
llama3/llama-3.2/*
176+
llama3/llama-3.2/*
177+
# Backups locais
178+
*.backup
179+
Makefile.backup
180+
core/media.backup/
181+
182+
# Arquivos de trabalho temporário
183+
diff.txt
184+
185+
# Modelos de AI (muito grandes)
186+
models/
187+
188+
# Binários
189+
appimagetool
190+
191+
# Migrations geradas localmente
192+
reference/migrations/0002_rename_estatus_to_status.py

Makefile

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ stop: ## Stop all app using $(compose)
5555

5656
restart:
5757
@docker compose -f $(compose) restart
58-
58+
5959
ps: ## See all containers using $(compose)
6060
@docker compose -f $(compose) ps
6161

@@ -102,10 +102,10 @@ django_load_auth: ## Run manage.py dumpdata auth --indent=2 $(compose)
102102
@docker compose -f $(compose) run --rm django python manage.py loaddata --database=default fixtures/auth.json
103103

104104
dump_data: ## Dump database into .sql $(compose)
105-
docker exec -t scielo_markup_local_postgres pg_dumpall -c -U debug > dump_`date +%d-%m-%Y"_"%H_%M_%S`.sql
105+
docker exec -t markapi_local_postgres pg_dumpall -c -U debug > dump_`date +%d-%m-%Y"_"%H_%M_%S`.sql
106106

107107
restore_data: ## Restore database into from latest.sql file $(compose)
108-
cat backup/latest.sql | docker exec -i scielo_markup_local_postgres psql -U debug
108+
cat backup/latest.sql | docker exec -i markapi_local_postgres psql -U debug
109109

110110
############################################
111111
## Atalhos Úteis ##
@@ -133,5 +133,4 @@ clean_migrations: ## Remove all migrations
133133
@echo "Migrations cleaned successfully."
134134

135135
clean_celery_logs:
136-
@sudo truncate -s 0 $$(docker inspect --format='{{.LogPath}}' scielo_markup_local_celeryworker)
137-
136+
@sudo truncate -s 0 $$(docker inspect --format='{{.LogPath}}' markapi_local_celeryworker)

requirements/local.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
-r base.txt
2+
-r extra-llama.txt
23

34
Werkzeug==3.0.1 # https://github.com/pallets/werkzeug
45
ipdb==0.13.13 # https://github.com/gotcha/ipdb
@@ -8,4 +9,4 @@ watchgod==0.8.2 # https://github.com/samuelcolvin/watchgod
89
django-extensions==3.2.3 # https://github.com/django-extensions/django-extensions
910
django-debug-toolbar # https://github.com/jazzband/django-debug-toolbar
1011

11-
pytest >= 7.0.7
12+
pytest >= 7.0.7-r

scielo_xml_tools.yml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
services:
2+
django: &django
3+
build:
4+
context: .
5+
dockerfile: ./compose/local/django/Dockerfile
6+
args:
7+
BUILD_ENVIRONMENT: local
8+
image: markapi_local_django
9+
container_name: markapi_local_django
10+
depends_on:
11+
- redis
12+
- postgres
13+
- mailhog
14+
volumes:
15+
- .:/app:z
16+
- ../markup_data/media:/app/core/media
17+
env_file:
18+
- ./.envs/.local/.django
19+
- ./.envs/.local/.postgres
20+
ports:
21+
- "8009:8000"
22+
command: /start
23+
24+
mailhog:
25+
image: mailhog/mailhog:v1.0.0
26+
container_name: markapi_local_mailhog
27+
ports:
28+
- "8029:8025"
29+
30+
postgres:
31+
build:
32+
context: .
33+
dockerfile: ./compose/production/postgres/Dockerfile
34+
image: markapi_local_postgres
35+
container_name: markapi_local_postgres
36+
volumes:
37+
# - ../scms_data/markapi/data_dev:/var/lib/postgresql/data:Z
38+
# - ../scms_data/markapi/data_dev_backup:/backups:z
39+
- ../markup_data/database/data:/var/lib/postgresql/data:Z
40+
- ../markup_data/database/backup:/backups:z
41+
ports:
42+
- "5439:5432"
43+
env_file:
44+
- ./.envs/.local/.postgres
45+
46+
redis:
47+
image: redis:6
48+
container_name: markapi_local_redis
49+
ports:
50+
- "6399:6379"
51+
52+
celeryworker:
53+
<<: *django
54+
image: markapi_local_celeryworker
55+
container_name: markapi_local_celeryworker
56+
depends_on:
57+
- redis
58+
- postgres
59+
- mailhog
60+
ports: []
61+
command: /start-celeryworker
62+
63+
celerybeat:
64+
<<: *django
65+
image: markapi_local_celerybeat
66+
container_name: markapi_local_celerybeat
67+
depends_on:
68+
- redis
69+
- postgres
70+
- mailhog
71+
ports: []
72+
command: /start-celerybeat
73+
74+
flower:
75+
<<: *django
76+
image: markapi_local_flower
77+
container_name: markapi_local_flower
78+
ports:
79+
- "5559:5555"
80+
command: /start-flower

0 commit comments

Comments
 (0)