-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
71 lines (67 loc) · 1.96 KB
/
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
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
# Comments are provided throughout this file to help you get started.
# If you need more help, visit the Docker compose reference guide at
# https://docs.docker.com/compose/compose-file/
# Here the instructions define your application as a service called "server".
# This service is built from the Dockerfile in the current directory.
# You can add other services your application may depend on here, such as a
# database or a cache. For examples, see the Awesome Compose repository:
# https://github.com/docker/awesome-compose
services:
server:
restart: on-failure
build:
context: .
container_name: startwars_container
environment:
PORT: 3000
NODE_ENV: production
AMQP_URL: amqp://admin:admin@rabbitmq:5672
MONGODB_URI: mongodb://user:pass@mongodb
MONGODB_DBNAME: startwars
API_URL: https://swapi.dev/api
ENABLE_SWAGGER: true
WORKERS: 2
HOST: localhost:3000
AUTORESTART: false
ports:
- 3000:3000
depends_on:
mongodb:
condition: service_started
rabbitmq:
condition: service_healthy
links:
- rabbitmq
- mongodb
# profiles:
# - donotstart
rabbitmq:
image: "rabbitmq:3.8-management-alpine"
container_name: rabbitmq_container
hostname: rabbitmq
ports:
- "15672:15672"
- "5672:5672"
healthcheck:
test: rabbitmq-diagnostics check_port_connectivity
interval: 10s
timeout: 1m
retries: 10
start_period: 1m
volumes:
- "./.tmp/rabbitmq_data:/var/lib/rabbitmq/mnesia"
environment:
- RABBITMQ_DEFAULT_USER=admin
- RABBITMQ_DEFAULT_PASS=admin
mongodb:
image: mongodb/mongodb-community-server:6.0-ubi8
container_name: mongodb_container
ports:
- '27017:27017'
environment:
- MONGODB_INITDB_ROOT_USERNAME=user
- MONGODB_INITDB_ROOT_PASSWORD=pass
volumes:
- type: bind
source: ./.tmp/mongodb
target: /data/db