Skip to content

Commit 5375fb4

Browse files
committed
Added a dedicated ARM configuration for docker-compose
1 parent c7b714c commit 5375fb4

File tree

10 files changed

+116
-7
lines changed

10 files changed

+116
-7
lines changed

workshops/introduction_to_event_sourcing/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ Follow the instructions in exercises folders.
5555

5656
## Ensuring that all is setup correctly
5757

58-
1. Run: `docker compose up` to start PostgreSQL, EventStoreDB, MongoDB docker images.
58+
1. Run `docker compose up` (or for Mac `docker compose -f docker-compose.arm.yml up`) to start PostgreSQL, EventStoreDB, MongoDB docker images.
59+
5960
2. Run `npm run test:solved`. If all is fine then all tests should be green.
6061

6162
## Running
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
version: '3'
2+
3+
services:
4+
#######################################################
5+
# EventStoreDB
6+
#######################################################
7+
eventstoredb:
8+
# image: eventstore/eventstore:24.10.0-bookworm-slim
9+
# use this image if you're running ARM-based proc like Apple M1
10+
image: eventstore/eventstore:24.10.0-alpha-arm64v8
11+
environment:
12+
- EVENTSTORE_CLUSTER_SIZE=1
13+
- EVENTSTORE_RUN_PROJECTIONS=All
14+
- EVENTSTORE_START_STANDARD_PROJECTIONS=true
15+
- EVENTSTORE_NODE_PORT=2113
16+
- EVENTSTORE_INSECURE=true
17+
- EVENTSTORE_ENABLE_ATOM_PUB_OVER_HTTP=true
18+
ports:
19+
- '1113:1113'
20+
- '2113:2113'
21+
volumes:
22+
- type: volume
23+
source: eventstore-volume-data
24+
target: /var/lib/eventstore
25+
- type: volume
26+
source: eventstore-volume-logs
27+
target: /var/log/eventstore
28+
networks:
29+
- esdb_network
30+
31+
#######################################################
32+
# MongoDB
33+
#######################################################
34+
mongodb:
35+
image: mongo:6.0.12
36+
# environment:
37+
# MONGO_INITDB_ROOT_USERNAME: root
38+
# MONGO_INITDB_ROOT_PASSWORD: rootpassword
39+
ports:
40+
- 27017:27017
41+
volumes:
42+
- mongodb-data:/data/db
43+
networks:
44+
- mongodb_network
45+
46+
mongo-express:
47+
image: mongo-express
48+
restart: always
49+
ports:
50+
- 8081:8081
51+
environment:
52+
# ME_CONFIG_MONGODB_ADMINUSERNAME: root
53+
# ME_CONFIG_MONGODB_ADMINPASSWORD: example
54+
# ME_CONFIG_MONGODB_URL: mongodb://root:example@mongodb:27017/
55+
ME_CONFIG_MONGODB_URL: mongodb://mongodb:27017/
56+
networks:
57+
- mongodb_network
58+
59+
#######################################################
60+
# PostgreSQL
61+
#######################################################
62+
postgres:
63+
image: postgres:15.1-alpine
64+
container_name: postgres
65+
environment:
66+
- POSTGRES_DB=postgres
67+
- POSTGRES_PASSWORD=postgres
68+
- POSTGRES_USER=postgres
69+
ports:
70+
- 5432:5432
71+
networks:
72+
- postgresql_network
73+
74+
pgadmin:
75+
image: dpage/pgadmin4
76+
container_name: pgadmin
77+
environment:
78+
PGADMIN_DEFAULT_EMAIL: ${PGADMIN_DEFAULT_EMAIL:-admin@pgadmin.org}
79+
PGADMIN_DEFAULT_PASSWORD: ${PGADMIN_DEFAULT_PASSWORD:-admin}
80+
ports:
81+
- '${PGADMIN_PORT:-5050}:80'
82+
networks:
83+
- postgresql_network
84+
85+
networks:
86+
esdb_network:
87+
driver: bridge
88+
postgresql_network:
89+
driver: bridge
90+
mongodb_network:
91+
driver: bridge
92+
93+
volumes:
94+
eventstore-volume-data:
95+
eventstore-volume-logs:
96+
mongodb-data:

workshops/introduction_to_event_sourcing/src/03_appending_events_eventstoredb/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,10 @@ Run [docker compose](../docker-compose.yml) script from the main workshop reposi
1010
docker compose up
1111
```
1212

13+
or for Mac:
14+
15+
```shell
16+
docker compose -f docker-compose.arm.yml up
17+
```
18+
1319
After that you can use EventStoreDB UI to see how streams and events look like. It's available at: http://localhost:2113/.

workshops/introduction_to_event_sourcing/src/04_appending_events_emmett/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Using a defined structure of events from the [first exercise](../01_events_defin
1414
ES_USE_TEST_CONTAINERS=false
1515
```
1616

17-
2. Then run: `docker compose up` to start EventStoreDB docker image.You should automatically get:
17+
2. Then run: `docker compose up` (or for Mac `docker compose -f docker-compose.arm.yml up`) to start EventStoreDB docker image.You should automatically get:
1818

1919
- EventStoreDB UI: http://localhost:2113/
2020
- Mongo Express UI: http://localhost:8081/

workshops/introduction_to_event_sourcing/src/09_application_logic_eventstoredb/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Having the following shopping cart process:
1313

1414
And business logic implemented in the [previous exercise](../05_business_logic/) write the application code that will _glue_ the API defined in `api.ts` files with the domain code.
1515

16-
This time you'll use EventStoreDB instead of the mocked one. Run `docker compose up` before running test code to have database set up.
16+
This time you'll use EventStoreDB instead of the mocked one. Run `docker compose up` (or for Mac `docker compose -f docker-compose.arm.yml up`) before running test code to have database set up.
1717

1818
There are four variations:
1919

workshops/introduction_to_event_sourcing/src/10_optimistic_concurrency_eventstoredb/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ And business logic and application code implemented in the [previous exercise](.
1717
- [MDN - HTTP conditional requests](https://developer.mozilla.org/en-US/docs/Web/HTTP/Conditional_requests)
1818
- [EventStoreDB Documentation - Handling concurrency](https://developers.eventstore.com/clients/grpc/appending-events.html#handling-concurrency)
1919

20-
This time you'll use EventStoreDB instead of the mocked one. Run `docker compose up` before running test code to have database set up.
20+
This time you'll use EventStoreDB instead of the mocked one. Run `docker compose up` (or for Mac `docker compose -f docker-compose.arm.yml up`) before running test code to have database set up.
2121

2222
There are four variations:
2323

workshops/introduction_to_event_sourcing/src/solved/03_appending_events_eventstoredb/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@ Run [docker compose](../docker-compose.yml) script from the main workshop reposi
1010
docker compose up
1111
```
1212

13+
or for Mac:
14+
15+
```shell
16+
docker compose -f docker-compose.arm.yml up
17+
```
18+
1319
After that you can use EventStoreDB UI to see how streams and events look like. It's available at: http://localhost:2113/.
1420

1521
## Solution

workshops/introduction_to_event_sourcing/src/solved/04_appending_events_emmett/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Using a defined structure of events from the [first exercise](../01_events_defin
1414
ES_USE_TEST_CONTAINERS=false
1515
```
1616

17-
2. Then run: `docker compose up` to start EventStoreDB docker image.You should automatically get:
17+
2. Then run: `docker compose up` (or for Mac `docker compose -f docker-compose.arm.yml up`) to start EventStoreDB docker image.You should automatically get:
1818

1919
- EventStoreDB UI: http://localhost:2113/
2020
- Mongo Express UI: http://localhost:8081/

workshops/introduction_to_event_sourcing/src/solved/09_application_logic_eventstoredb/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Having the following shopping cart process:
1313

1414
And business logic implemented in the [previous exercise](../05_business_logic/) write the application code that will _glue_ the API defined in `api.ts` files with the domain code.
1515

16-
This time you'll use EventStoreDB instead of the mocked one. Run `docker compose up` before running test code to have database set up.
16+
This time you'll use EventStoreDB instead of the mocked one. Run `docker compose up` (or for Mac `docker compose -f docker-compose.arm.yml up`) before running test code to have database set up.
1717

1818
There are four variations:
1919

workshops/introduction_to_event_sourcing/src/solved/10_optimistic_concurrency_eventstoredb/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ And business logic and application code implemented in the [previous exercise](.
1717
- [MDN - HTTP conditional requests](https://developer.mozilla.org/en-US/docs/Web/HTTP/Conditional_requests)
1818
- [EventStoreDB Documentation - Handling concurrency](https://developers.eventstore.com/clients/grpc/appending-events.html#handling-concurrency)
1919

20-
This time you'll use EventStoreDB instead of the mocked one. Run `docker compose up` before running test code to have database set up.
20+
This time you'll use EventStoreDB instead of the mocked one. Run `docker compose up` (or for Mac `docker compose -f docker-compose.arm.yml up`) before running test code to have database set up.
2121

2222
There are four variations:
2323

0 commit comments

Comments
 (0)