-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
77 lines (71 loc) · 1.95 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
72
73
74
75
76
77
services:
frontend:
build:
context: ./ExchangeRates.Frontend
dockerfile: Dockerfile
ports:
- "${FRONTEND_PORT}:80"
environment:
- BACKEND_URL=http://localhost:${BACKEND_PORT}
networks:
- default
api:
build:
context: .
dockerfile: ./ExchangeRates.Api/Dockerfile
ports:
- "${BACKEND_PORT}:${BACKEND_PORT}"
environment:
- ConnectionStrings__Postgres=Server=postgres;Port=${POSTGRES_PORT};Database=${POSTGRES_DB};User Id=${POSTGRES_USER};Password=${POSTGRES_PASSWORD};
- ConnectionStrings__Redis=${REDIS_HOST}:${REDIS_PORT}
- ExternalApi__Url=${EXTERNAL_API_URL}
- ExternalApi__Key=${EXTERNAL_API_KEY}
- ASPNETCORE_ENVIRONMENT=Development
- ASPNETCORE_HTTP_PORTS=8080
depends_on:
- postgres
- redis
networks:
- default
fetcher:
build:
context: .
dockerfile: ./ExchangeRates.Fetcher/Dockerfile
ports:
- "5001:5001"
environment:
- ConnectionStrings__Postgres=Server=postgres;Port=${POSTGRES_PORT};Database=${POSTGRES_DB};User Id=${POSTGRES_USER};Password=${POSTGRES_PASSWORD};
- ConnectionStrings__Redis=${REDIS_HOST}:${REDIS_PORT}
- ExternalApi__Url=${EXTERNAL_API_URL}
- ExternalApi__Key=${EXTERNAL_API_KEY}
depends_on:
- postgres
- redis
networks:
- default
redis:
image: redis:7
container_name: redis
ports:
- "${REDIS_PORT}:${REDIS_PORT}"
networks:
- default
postgres:
image: postgres:15
container_name: postgres
environment:
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: ${POSTGRES_DB}
ports:
- "${POSTGRES_PORT}:${POSTGRES_PORT}"
networks:
- default
volumes:
- ./DatabaseInitialization:/docker-entrypoint-initdb.d:ro
- postgres_data:/var/lib/postgresql/data
networks:
default:
driver: bridge
volumes:
postgres_data: