-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
61 lines (52 loc) · 1.64 KB
/
docker-compose.yml
File metadata and controls
61 lines (52 loc) · 1.64 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
version: '3.8'
# This is the docker compose to run this proejct. It is composed of 3 services:
# 1. api: The main API service that handles incoming requests.
# 2. mongo: The MongoDB service for data storage.
# 3. load-test: A service for running load tests against the API.
# The api service is built from the Dockerfile in the current directory and exposes port 8081.
# It depends on the mongo service, which is built from the official MongoDB image and exposes port 27017.
# The load-test service is built from the same Dockerfile and runs load tests against the API.
# Just run `docker-compose up` to start all services, or `docker-compose up api` to start only the API service. etc
# if you want to see it spit out some logs while running: `docker-compose up -d` is what you're looking for
services:
api:
build:
context: .
dockerfile: Dockerfile
ports:
- "8081:8081"
environment:
- SERVER_HOST=0.0.0.0
- SERVER_PORT=8081
- MONGODB_URI=mongodb://mongo:27017
- MONGODB_DATABASE=catchall
- DELIVERED_THRESHOLD=1000
command: ["-processor", "-workers=8"]
depends_on:
- mongo
restart: unless-stopped
networks:
- catchall-network
mongo:
image: mongo:6.0
ports:
- "27017:27017"
volumes:
- mongo-data:/data/db
networks:
- catchall-network
# For larger scale testing and development
load-test:
build:
context: .
dockerfile: Dockerfile
command: ["go", "test", "-bench=.", "./pkg/eventpool"]
networks:
- catchall-network
profiles:
- testing
networks:
catchall-network:
driver: bridge
volumes:
mongo-data: