CONFIG: preparar dockerfile y compose para gitea vps
This commit is contained in:
+10
-19
@@ -1,18 +1,6 @@
|
||||
version: '3.8'
|
||||
|
||||
services:
|
||||
db:
|
||||
image: postgres:15-alpine
|
||||
environment:
|
||||
POSTGRES_DB: efintel_db
|
||||
POSTGRES_USER: efintel_user
|
||||
POSTGRES_PASSWORD: efintel_password
|
||||
ports:
|
||||
- "5432:5432"
|
||||
volumes:
|
||||
- postgres_data:/var/lib/postgresql/data
|
||||
restart: unless-stopped
|
||||
|
||||
redis:
|
||||
image: redis:7-alpine
|
||||
ports:
|
||||
@@ -20,10 +8,12 @@ services:
|
||||
volumes:
|
||||
- redis_data:/data
|
||||
restart: unless-stopped
|
||||
mem_limit: 512m # Limita Redis a 512MB de memoria RAM
|
||||
|
||||
web:
|
||||
build: .
|
||||
command: daphne -b 0.0.0.0 -p 8000 config.asgi:application
|
||||
# Se sobrescribe el comando para asegurarnos que usa Gunicorn (así esté en el Dockerfile)
|
||||
command: gunicorn config.asgi:application -k uvicorn.workers.UvicornWorker --bind 0.0.0.0:8000 --workers 3
|
||||
volumes:
|
||||
- .:/app
|
||||
ports:
|
||||
@@ -31,32 +21,33 @@ services:
|
||||
env_file:
|
||||
- .env
|
||||
environment:
|
||||
DATABASE_URL: postgres://efintel_user:efintel_password@db:5432/efintel_db
|
||||
# Ya no conectamos a una DB local, lee el DATABASE_URL del .env
|
||||
REDIS_URL: redis://redis:6379/0
|
||||
depends_on:
|
||||
- db
|
||||
- redis
|
||||
restart: unless-stopped
|
||||
mem_limit: 1g # Limita Gunicorn a 1GB
|
||||
|
||||
tax-api:
|
||||
build: ./tax_api
|
||||
ports:
|
||||
- "8001:8000"
|
||||
restart: unless-stopped
|
||||
mem_limit: 256m
|
||||
|
||||
celery:
|
||||
build: .
|
||||
command: celery -A config worker -l info
|
||||
command: celery -A config worker -l info --concurrency=2
|
||||
volumes:
|
||||
- .:/app
|
||||
env_file:
|
||||
- .env
|
||||
environment:
|
||||
DATABASE_URL: postgres://efintel_user:efintel_password@db:5432/efintel_db
|
||||
REDIS_URL: redis://redis:6379/0
|
||||
depends_on:
|
||||
- db
|
||||
- redis
|
||||
restart: unless-stopped
|
||||
mem_limit: 512m # Limita Celery a 512MB
|
||||
|
||||
volumes:
|
||||
postgres_data:
|
||||
redis_data:
|
||||
|
||||
Reference in New Issue
Block a user