-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
101 lines (100 loc) · 2.89 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
version: "3.9"
services:
db:
build: ../db
hostname: readup-db
environment:
- POSTGRES_PASSWORD=postgres
volumes:
- ../db:/db
- db-data:/var/lib/postgresql/data
# Also expose ports for compatibility with external nginx reverse proxy
ports:
- "5432:5432"
api:
depends_on:
- db
build: ../api
hostname: readup-api
environment:
- ASPNETCORE_ENVIRONMENT=Development
# Also expose ports for external testing
ports:
- "5000:5000"
volumes:
- ../api:/api
web:
depends_on:
- api
build: ../web
hostname: readup-web
ports:
- "5001:5001"
volumes:
- ../web:/web
# This allows `web` to access api.dev.readup.org, leave the containers
# to the host at localhost, then enter the proxy container via the mapped localhost:443,
# and then get directed to the `api` container via the proxy.
#
# TODO: this seems inefficient, it's maybe possible to skip this indirection via the host:
# - Somehow direct api.dev.readup.org within `web` to readup-proxy
# (it's not possible with extra_hosts. Maybe with a DNS server inside `web`?
# If that's more efficient.)
# - Or, web's config files could not try to connect to https://api.dev.readup.org,
# but to http://readup-api:5001 instead, in case of the Docker dev env.
# However, then we lose the HTTPS at the proxy level.
extra_hosts:
- "api.dev.readup.org:host-gateway"
# Reverse proxy + static server
# See ./readme.md
proxy:
# nginx will report emergency failures when upstream hosts are not found (readup-api, readup-web)
depends_on:
- web
- api
build:
context: .
dockerfile: docker-reverse-proxy/Dockerfile
hostname: readup-proxy
ports:
- "443:443"
volumes:
# The reverse proxy needs to access several repositories
# to statically host certain directories and files under
# static.dev.readup.org
# See ./docker-reverse-proxy/nginx.conf
- ../static/content:/static:ro
- ../web:/web:ro
- ../blog:/blog:ro
# Starts a watching build server that is accessible via https://blog.dev.readup.org (via proxy)
blog:
image: jekyll/jekyll:4.1.0
profiles:
- blog
command: ["jekyll", "build", "-w"]
depends_on:
- proxy
volumes:
- ../blog:/srv/jekyll:Z
mail:
build: https://github.com/sj26/mailcatcher.git#main
depends_on:
- api
profiles:
- mail
hostname: readup-mail
ports:
# Publish port to view the interface at http://localhost:1080
- "1080:1080"
article-test-server:
build: ../article-test-server
hostname: article-test-server
profiles:
- article-testing
environment:
- ASPNETCORE_ENVIRONMENT=Development
# Also expose ports for external testing
ports:
- "5002:5002"
volumes:
db-data: