Repository navigation
Expand file tree
/
Copy pathcompose.local.yaml
More file actions
169 lines (168 loc) · 6.54 KB
/
Copy pathcompose.local.yaml
File metadata and controls
169 lines (168 loc) · 6.54 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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
x-storage-environment: &storage_environment
S3_ENDPOINT: http://rustfs:9000
S3_BUCKET: scanner-fixture
AWS_REGION: us-east-1
AWS_ACCESS_KEY_ID: storage-smoke-access
AWS_SECRET_ACCESS_KEY: storage-smoke-secret
ACTIVE_STORAGE_S3_ENDPOINT: http://rustfs:9000
ACTIVE_STORAGE_S3_BUCKET: medtracker-fixture
ACTIVE_STORAGE_S3_REGION: us-east-1
ACTIVE_STORAGE_S3_ACCESS_KEY_ID: storage-smoke-access
ACTIVE_STORAGE_S3_SECRET_ACCESS_KEY: storage-smoke-secret
ACTIVE_STORAGE_S3_FORCE_PATH_STYLE: "true"
services:
mailpit:
environment:
MP_SMTP_BIND_ADDR: "0.0.0.0:${MEDTRACKER_SMTP_PORT:-1025}"
ports: !override
- target: ${MEDTRACKER_SMTP_PORT:-1025}
host_ip: 127.0.0.1
- target: 8025
host_ip: 127.0.0.1
postgres:
volumes:
- database:/var/lib/postgresql
tool:
profiles: [dev, test]
build:
context: .
target: ${MT_TOOL_TARGET}
image: ${MT_PROJECT}-tool
working_dir: /app
init: true
environment: &tool_environment
DATABASE_URL: postgres://medtracker:medtracker_password@postgres/medtracker_loco
MEDTRACKER_OWNED_DATABASE: "1"
MEDTRACKER_OWNED_STORAGE: "1"
CARGO_INCREMENTAL: "1"
CARGO_BUILD_JOBS: "2"
NEXTEST_TEST_THREADS:
CARGO_PROFILE_DEV_DEBUG: "0"
CARGO_PROFILE_TEST_DEBUG: "0"
BINDING: 0.0.0.0
MEDTRACKER_SESSION_KEY: BwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBw==
<<: *storage_environment
volumes:
- cargo-registry:/usr/local/cargo/registry
- cargo-git:/usr/local/cargo/git
- target:/app/target
- browser-cache:/root/.cache
command: [sleep, infinity]
dev-tool:
extends: tool
profiles: !override [dev]
volumes:
- ./src:/app/src:ro
- ./migration:/app/migration:ro
- ./assets:/app/assets
- ./config:/app/config:ro
- ./tests:/app/tests:ro
- ./docs/api/openapi.v1.yaml:/app/docs/api/openapi.v1.yaml:ro
- ./scripts:/app/scripts:ro
- ./Cargo.toml:/app/Cargo.toml:ro
- ./Cargo.lock:/app/Cargo.lock:ro
- ./build.rs:/app/build.rs:ro
- ./Dockerfile:/app/Dockerfile:ro
- ./package.json:/app/package.json:ro
- ./package-lock.json:/app/package-lock.json:ro
- dev-runtime:/app/run
dev-frontend:
extends: dev-tool
profiles: !override [dev]
command: [/app/node_modules/.bin/tailwindcss, --cwd, /app/assets, -i, /app/assets/static/css/app.css, -o, /app/assets/static/css/compiled.css, --minify, --watch=always]
dev-builder:
extends: dev-tool
profiles: !override [dev]
command: [cargo, watch, --poll, --postpone, -w, src, -w, migration, -w, Cargo.toml, -w, Cargo.lock, -w, build.rs, -w, Dockerfile, -w, assets/security, -w, assets/catalogue, -w, assets/reports/locales, -w, assets/reports/terminology, -w, assets/static/icon.png, -w, assets/static/js/profile-push-worker.js, -s, "cargo install --path . --debug --locked --force --bin med-tracker --target-dir /app/target --root /app/run"]
dev-app:
extends: dev-tool
profiles: !override [dev]
environment:
MEDTRACKER_PUBLIC_ORIGIN: ${MT_PUBLIC_ORIGIN:-}
MEDTRACKER_COOKIE_SECURE: ${MT_COOKIE_SECURE:-true}
MEDTRACKER_CAPTURE_MAIL: ${MEDTRACKER_CAPTURE_MAIL:-false}
MEDTRACKER_SMTP_HOST: mailpit
MEDTRACKER_SMTP_PORT: ${MEDTRACKER_SMTP_PORT:-1025}
MEDTRACKER_INVITATION_MAIL_FROM: "${MEDTRACKER_INVITATION_MAIL_FROM:-MedTracker <invitations@medtracker.test>}"
DATABASE_URL: postgres://medtracker_runtime:synthetic_local_runtime_password@postgres/medtracker_loco
command: [cargo, watch, --poll, --ignore-nothing, -w, /app/run/bin/med-tracker, -w, assets/views, -w, config, --, /app/run/bin/med-tracker, start, --server-and-worker, --environment, development]
ports:
- target: 5150
published: ${MT_HTTP_PORT:-0}
host_ip: 127.0.0.1
dev-scheduler:
extends: dev-tool
profiles: !override [dev]
environment:
MEDTRACKER_PUBLIC_ORIGIN: ${MT_PUBLIC_ORIGIN:-}
MEDTRACKER_COOKIE_SECURE: ${MT_COOKIE_SECURE:-true}
DATABASE_URL: postgres://medtracker_runtime:synthetic_local_runtime_password@postgres/medtracker_loco
command: [cargo, watch, --poll, --ignore-nothing, -w, /app/run/bin/med-tracker, -w, config, --, /app/run/bin/med-tracker, scheduler, --environment, development]
test-app:
extends: tool
profiles: !override [test]
environment:
MEDTRACKER_PUBLIC_ORIGIN: ${MT_PUBLIC_ORIGIN:-}
MEDTRACKER_COOKIE_SECURE: ${MT_COOKIE_SECURE:-true}
DATABASE_URL: postgres://medtracker_runtime:synthetic_local_runtime_password@postgres/medtracker_loco
command: [cargo, run, --locked, --, start, --server-and-worker, --environment, test]
ports:
- target: 5150
published: ${MT_HTTP_PORT:-0}
host_ip: 127.0.0.1
test-scheduler:
extends: tool
profiles: !override [test]
environment:
MEDTRACKER_PUBLIC_ORIGIN: ${MT_PUBLIC_ORIGIN:-}
MEDTRACKER_COOKIE_SECURE: ${MT_COOKIE_SECURE:-true}
DATABASE_URL: postgres://medtracker_runtime:synthetic_local_runtime_password@postgres/medtracker_loco
command: [cargo, run, --locked, --, scheduler, --environment, test]
app:
profiles: [prod]
build:
context: .
target: runtime
image: ${LOCO_IMAGE:-${MT_PROJECT}-runtime}
environment: &runtime_environment
<<: *storage_environment
DATABASE_URL: postgres://medtracker_runtime:synthetic_local_runtime_password@postgres/medtracker_loco
MEDTRACKER_PUBLIC_ORIGIN: ${MT_PUBLIC_ORIGIN:-}
MEDTRACKER_SESSION_KEY: BwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBw==
AUTH_SESSION_SECRET: synthetic-local-production-secret-at-least-32-characters
read_only: true
cap_drop: [ALL]
security_opt: [no-new-privileges:true]
tmpfs: ["/tmp:uid=65532,gid=65532"]
command: [start, --server-and-worker, --environment, production]
ports:
- target: 5150
host_ip: 127.0.0.1
scheduler:
extends: app
profiles: [prod]
ports: !reset []
command: [scheduler, --environment, production]
volumes:
database:
labels:
io.medtracker.local-owner: ${MT_PROJECT}
scanner-data:
labels:
io.medtracker.local-owner: ${MT_PROJECT}
scanner-logs:
labels:
io.medtracker.local-owner: ${MT_PROJECT}
dev-runtime:
cargo-registry:
external: true
name: ${MT_CARGO_REGISTRY_CACHE}
cargo-git:
external: true
name: ${MT_CARGO_GIT_CACHE}
target:
external: true
name: ${MT_TARGET_CACHE}
browser-cache:
external: true
name: ${MT_BROWSER_CACHE}