Modificado el Docker-compose

This commit is contained in:
Mireya Cueto Garrido
2026-03-26 09:17:41 +01:00
parent 30f87732f8
commit e9a3bf6c21
+27
View File
@@ -1,17 +1,44 @@
version: "3.9"
services: services:
backend: backend:
build: build:
context: ./backend context: ./backend
container_name: backend
ports: ports:
- "8000:8000" - "8000:8000"
volumes: volumes:
- ./backend:/app - ./backend:/app
depends_on:
- db
environment:
DB_HOST: db
DB_PORT: 3306
DB_USER: root
DB_PASSWORD: root
DB_NAME: deckofcards
frontend: frontend:
build: build:
context: ./frontend context: ./frontend
container_name: frontend
ports: ports:
- "5173:5173" - "5173:5173"
volumes: volumes:
- ./frontend:/app - ./frontend:/app
- /app/node_modules - /app/node_modules
db:
image: mysql:8.0
container_name: mysql_db
restart: always
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: deckofcards
ports:
- "3306:3306"
volumes:
- mysql_data:/var/lib/mysql
volumes:
mysql_data: