Initial commit - estructura completa del proyecto
This commit is contained in:
83
docker-compose.yml
Normal file
83
docker-compose.yml
Normal file
@@ -0,0 +1,83 @@
|
||||
version: '3.8'
|
||||
|
||||
services:
|
||||
# Base de datos PostgreSQL
|
||||
db:
|
||||
image: postgres:15
|
||||
container_name: pycore_db
|
||||
environment:
|
||||
POSTGRES_DB: pycore_db
|
||||
POSTGRES_USER: Scorpion
|
||||
POSTGRES_PASSWORD: CyCoT256
|
||||
volumes:
|
||||
- postgres_data:/var/lib/postgresql/data
|
||||
- ./postgres/init:/docker-entrypoint-initdb.d
|
||||
ports:
|
||||
- "5432:5432"
|
||||
networks:
|
||||
- pycore_network
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U Scorpion -d pycore_db"]
|
||||
interval: 5s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
# PgAdmin
|
||||
pgadmin:
|
||||
image: dpage/pgadmin4
|
||||
container_name: pycore_pgadmin
|
||||
environment:
|
||||
PGADMIN_DEFAULT_EMAIL: admin@pycore.com
|
||||
PGADMIN_DEFAULT_PASSWORD: CyCoT256
|
||||
ports:
|
||||
- "5050:80"
|
||||
depends_on:
|
||||
- db
|
||||
networks:
|
||||
- pycore_network
|
||||
|
||||
# Backend Django
|
||||
backend:
|
||||
build: ./backend
|
||||
container_name: pycore_backend
|
||||
volumes:
|
||||
- ./backend:/app
|
||||
ports:
|
||||
- "8000:8000"
|
||||
depends_on:
|
||||
db:
|
||||
condition: service_healthy
|
||||
environment:
|
||||
DATABASE_URL: postgresql://Scorpion:CyCoT256@db:5432/pycore_db
|
||||
DEBUG: "True"
|
||||
SECRET_KEY: "clave-secreta-temporal-2024"
|
||||
networks:
|
||||
- pycore_network
|
||||
command: >
|
||||
sh -c "echo 'Esperando a que la base de datos esté lista...' &&
|
||||
sleep 10 &&
|
||||
python manage.py migrate &&
|
||||
python manage.py runserver 0.0.0.0:8000"
|
||||
|
||||
# Frontend React
|
||||
frontend:
|
||||
build: ./frontend
|
||||
container_name: pycore_frontend
|
||||
volumes:
|
||||
- ./frontend:/app
|
||||
- /app/node_modules
|
||||
ports:
|
||||
- "3000:3000"
|
||||
depends_on:
|
||||
- backend
|
||||
environment:
|
||||
VITE_API_URL: http://localhost:8000/api
|
||||
networks:
|
||||
- pycore_network
|
||||
|
||||
networks:
|
||||
pycore_network:
|
||||
driver: bridge
|
||||
|
||||
volumes:
|
||||
postgres_data:
|
||||
Reference in New Issue
Block a user