-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yaml
65 lines (63 loc) · 1.84 KB
/
docker-compose.yaml
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
version: '3.8'
# Available tags: latest, nonroot, debug, debug-nonroot
# For more, see https://github.com/GoogleContainerTools/distroless#how-do-i-use-distroless-images
x-distroless-tag: &x-distroless-tag DISTROLESS_TAG=${DISTROLESS_TAG:-nonroot}
services:
# A persistent database for local development.
postgres-dev:
image: postgres:17
restart: always
environment:
POSTGRES_DB: spaced
POSTGRES_USER: admin
POSTGRES_PASSWORD: password
ports: ['5432:5432']
rabbitmq:
image: rabbitmq
restart: always
environment:
RABBITMQ_DEFAULT_USER: admin
RABBITMQ_DEFAULT_PASS: password
ports:
- 5672:5672
- 15672:15672
###################################
### OPTIONAL ###
###################################
# Reverse-proxy for when running spaced services
nginx:
image: nginx
restart: always
profiles: ['services']
volumes:
- ./config/nginx.conf:/etc/nginx/nginx.conf
- ./dist:/usr/share/nginx/html
ports:
- 7777:80
# Spaced services
item_producer:
image: spaced/item_producer:${IMAGE_TAG:-latest}
restart: always
profiles: ['services']
depends_on: [postgres-dev, rabbitmq]
environment:
- DATABASE_HOST=postgres://admin:password@postgres-dev/spaced
- AMQP_HOST=rabbitmq
- HOST=0.0.0.0
build:
dockerfile: srcs/services/item_producer/Dockerfile
args: [*x-distroless-tag]
ports: ['8080:8080']
user_service:
image: spaced/user_service:${IMAGE_TAG:-latest}
restart: always
profiles: ['services']
depends_on: [postgres-dev]
environment:
- DATABASE_HOST=postgres://admin:password@postgres-dev/spaced
- HOST=0.0.0.0
- JWT_SECRET=test
build:
dockerfile: srcs/services/user_service/Dockerfile
args: [*x-distroless-tag]
ports: ['8081:8081']