-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathdocker-compose.dev.yml
More file actions
133 lines (114 loc) · 4.33 KB
/
docker-compose.dev.yml
File metadata and controls
133 lines (114 loc) · 4.33 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
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
# Dev override for Deep Harbor.
# Use this alongside the main compose file to run locally
# without hardware dependencies and with bridge networking:
#
# docker compose -f docker-compose.yaml -f docker-compose.dev.yml up --build -d
#
# This file:
# 1. Disables hardware-dependent services (AD controller, RFID reader, RFID2DB)
# 2. Moves host-network services onto the bridge network so they can
# talk to other containers by name (gateway, db, etc.)
# 3. Sets DEV_MODE on worker services so they don't timeout waiting
# for the disabled hardware controllers
# 4. Mounts the seed data SQL file into the database init directory
# 5. Remaps gateway (80→8808) and Grafana (3000→3300) to avoid host port conflicts
services:
#########################################################
# Database — mount seed data
# The init order is:
# init.sql (extensions) → 01-pgsql_schema.sql (schema) → 02-seed_data.sql (seed data)
# The seed data file is created in issue #12. This just
# wires up the mount point so that issue doesn't need
# to touch this file.
#########################################################
db:
volumes:
- ./pg/sql/seed_data.local.sql:/docker-entrypoint-initdb.d/02-seed_data.sql
#########################################################
# Front-end services — move from host network to bridge
# The portals use network_mode: host in production so
# they can reach services on the host. In dev we put
# them on the bridge network instead, where they reach
# DHService through the nginx gateway container.
#########################################################
dhmemberportal:
network_mode: !reset ""
networks:
- dh_network
ports:
- "5002:5002"
environment:
DH_API_BASE_URL: "http://gateway/dh/service"
AUTH_MODE: dev
DEV_BANNER: "true"
DH_CLIENT_ID: "dev-member-portal"
DH_CLIENT_SECRET: "hQgPvJW9RU48tRSQKS8SladAZsKHS34fKetbNr_443E"
dhadminportal:
network_mode: !reset ""
networks:
- dh_network
ports:
- "5001:5001"
environment:
DH_API_BASE_URL: "http://gateway/dh/service"
AUTH_MODE: dev
DEV_BANNER: "true"
DH_CLIENT_ID: "dev-admin-portal"
DH_CLIENT_SECRET: "ikactyRLicKoI8VHiD9KZEwTrOIhtYjfzm1h6YUjj7M"
#########################################################
# External services — move st2dh from host to bridge
# ST2DH is the Stripe webhook receiver. It talks to
# DHService via HTTP, not directly to the database.
# The DATABASE_* env vars in the main compose are unused
# (see issue #21) so we don't repeat them here.
#########################################################
st2dh:
network_mode: !reset ""
networks:
- dh_network
ports:
- "5004:5004"
environment:
DH_API_BASE_URL: "http://gateway/dh/service"
#########################################################
# Worker services — set DEV_MODE so they short-circuit
# instead of trying to talk to the disabled hardware
# controllers via shared volume queues. Without this
# they'd timeout after 10s and return 500s, which
# cascades through the whole dispatcher pipeline.
# The actual code to respect DEV_MODE is in issue #18.
#########################################################
dh2ad:
environment:
DEV_MODE: "true"
dh2rfid:
environment:
DEV_MODE: "true"
#########################################################
# Gateway — remap to avoid host port 80 conflicts
#########################################################
gateway:
ports: !override
- "8808:80"
#########################################################
# Grafana — remap to avoid host port 3000 conflicts
#########################################################
grafana:
ports: !override
- "3300:3000"
#########################################################
# Hardware-dependent services — disabled for dev
# These need physical hardware or host network access
# that doesn't exist in a dev environment. They're
# gated behind the "hardware" profile so they only
# start if you explicitly pass --profile hardware.
#########################################################
dhadcontroller:
profiles:
- hardware
dhrfidreader:
profiles:
- hardware
rfid2db:
profiles:
- hardware