-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
42 lines (39 loc) · 1014 Bytes
/
docker-compose.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
version: '3.8'
services:
mysql:
image: mysql:8.0
container_name: mysql_db
environment:
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
MYSQL_DATABASE: ${MYSQL_DATABASE}
MYSQL_USER: ${MYSQL_USER}
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
ports:
- "3306:3306"
volumes:
- ./mysql_data:/var/lib/mysql
networks:
- app-network
command: --default-authentication-plugin=mysql_native_password # Evitar problemas de autenticación con algunas versiones de MySQL
api:
build:
context: .
dockerfile: Dockerfile
container_name: build_my_event_api
environment:
- DATABASE_URL=${DATABASE_URL}
- NODE_ENV=${NODE_ENV}
- PORT=${PORT}
ports:
- "3000:3000"
volumes:
- .:/usr/src/app
- /usr/src/app/node_modules
depends_on:
- mysql
networks:
- app-network
command: ["nodemon", "src/index.ts"] # Usa nodemon para la recarga automática
networks:
app-network:
driver: bridge