-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathcompose.yml
More file actions
74 lines (70 loc) · 1.82 KB
/
compose.yml
File metadata and controls
74 lines (70 loc) · 1.82 KB
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
services:
# API de Héroes
heroes-api:
build: ./app
container_name: heroes-api
restart: unless-stopped
ports:
- "3000:3000"
environment:
- NODE_ENV=production
- PORT=3000
- MONGODB_URI=mongodb://heroes_user:heroes_password@mongo:27017
depends_on:
- mongo
networks:
- heroes-network
healthcheck:
test: [ "CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost:3000/" ]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
develop:
watch:
- action: rebuild
path: ./app/src
# Base de datos MongoDB
mongo:
image: mongo:7-jammy
container_name: heroes-mongo
restart: unless-stopped
ports:
- "27017:27017"
environment:
- MONGO_INITDB_ROOT_USERNAME=heroes_user
- MONGO_INITDB_ROOT_PASSWORD=heroes_password
volumes:
- mongo_data:/data/db
- ./app/mongo-init:/docker-entrypoint-initdb.d
networks:
- heroes-network
healthcheck:
test: [ "CMD", "mongosh", "--eval", "db.adminCommand('ping')" ]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
# MongoDB Express (Interfaz web para administrar MongoDB)
mongo-express:
image: mongo-express:1.0.2
container_name: heroes-mongo-express
restart: unless-stopped
ports:
- "8081:8081"
environment:
- ME_CONFIG_MONGODB_ADMINUSERNAME=heroes_user
- ME_CONFIG_MONGODB_ADMINPASSWORD=heroes_password
- ME_CONFIG_MONGODB_URL=mongodb://heroes_user:heroes_password@mongo:27017/
- ME_CONFIG_BASICAUTH_USERNAME=admin
- ME_CONFIG_BASICAUTH_PASSWORD=midudevlemon
depends_on:
- mongo
networks:
- heroes-network
volumes:
mongo_data:
driver: local
networks:
heroes-network:
driver: bridge