Repository navigation
Expand file tree
/
Copy pathdevelopment.yml
More file actions
138 lines (134 loc) · 5.47 KB
/
Copy pathdevelopment.yml
File metadata and controls
138 lines (134 loc) · 5.47 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
services:
# don't show logs from those services
pgadmin:
logging:
driver: none
db:
logging:
driver: none
redis:
logging:
driver: none
cantaloupe:
logging:
driver: none
proxy:
ports:
- ${QABOARD_DEV_PROXY_PORT_5001:-5001}:5001
backend:
# With the compilers: `uv run` installs the dependencies in backend/.venv
# Build the dev target, never pull the published production image under the same tag
image: "${QABOARD_IMAGE:-ghcr.io/samsung/qaboard}:backend-dev"
build:
target: dev
volumes:
- ./qaboard:/qaboard/qaboard
- ./backend:/qaboard/backend
- ${HOME}:${HOME}
- ./pyproject.toml:/qaboard/pyproject.toml
- ./README.md:/qaboard/README.md:ro
environment:
- FLASK_APP=backend
- FLASK_ENV=development
- FLASK_DEBUG=1
# in dev we run as the user so we can't use the system python owned by root
- UV_PROJECT_ENVIRONMENT=
- PYTHONNOUSERSITE=1
# - QABOARD_DB_ECHO=true
- UWSGI_STATS=true
- QABOARD_DATA_DIR=/qaboard/backend/data
# At SIRC, deployments/sirc/.envrc sets QABOARD_DEV_DB_HOST to connect to the production database
- QABOARD_DB_HOST=${QABOARD_DEV_DB_HOST:-db}
- SSH_AUTH_SOCK=/ssh-agent
# Batches started from the web app (tuning, redo) are off unless you choose a runner: QABOARD_TUNING_RUNNER=local
# in .env runs them in this container, as the backend (anyone who can start one runs code here). Site overlays win
- QABOARD_TUNING_RUNNER=${QABOARD_TUNING_RUNNER:-}
working_dir: /qaboard/backend
# With what's just below, everything works except being able to delete files owned by other users
# We wish we could do this, then remove sudo from the dockerfile, and use this command...
# command: flask run --host 0.0.0.0 --with-threads --port 5152
# user: "11611:10"
# cap_add:
# - SETUID
# - SETGID
# But non-root users don't gain capabilities...
# uv add lxml xmlsec uwsgi --no-binary-package uwsgi --no-binary-package lxml --no-binary-package xmlsec --refresh-package lxml --refresh-package xmlsec --refresh-package uwsgi --no-cache --reinstall
# flask run --with-threads --host 0.0.0.0 --port 5152
# We run as your user if it exists in the container (e.g. at SIRC, services/backend/passwd is mounted), else as root.
# The jobs worker (Admin > Storage) doesn't reload when the code changes: restart the container.
# The proxy talks uwsgi to backend:3000: to check who can read files (500 errors without it), for the file browser
# under /s/ (folder listings, /api/v1/... calls: 502 errors)... Next to flask, uwsgi serves them (as you, not $UWSGI_UID)
# `flask routes` imports the app once first: it creates the missing tables (Base.metadata.create_all), which
# uwsgi, the jobs worker and flask would otherwise all do at the same time on an empty database, and race
command: >
bash -c "
serve='uv run flask routes > /dev/null; env -u UWSGI_UID -u UWSGI_GID uv run uwsgi --ini uwsgi.ini --py-autoreload 2 & uv run qaboard-admin jobs worker & exec uv run flask run --host 0.0.0.0 --with-threads --port 5152';
if id '${USER}' >/dev/null 2>&1; then
echo '${USER} ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers;
exec su '${USER}' -c \"$$serve\";
else
eval \"$$serve\";
fi
"
ports:
- "${QABOARD_DEV_BACKEND_PORT:-5152}:5152"
healthcheck:
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:5152/api/v1/health', timeout=5)"]
# logging:
# driver: json-file
frontend:
image: "${QABOARD_IMAGE:-ghcr.io/samsung/qaboard}:frontend-dev"
build:
target: dev
volumes:
- ./webapp:/app
# the "What's new" panel shows them, updated as you edit them
- ./website/release-notes:/website/release-notes:ro
- ./qaboard/schemas:/qaboard/schemas:ro
working_dir: /app
environment:
- HOME=/app
- NPM_CONFIG_USERCONFIG=/app
# Should we comment it out by default?
- HOST=0.0.0.0
- DANGEROUSLY_DISABLE_HOST_CHECK=true
- CHOKIDAR_USEPOLLING=true
# - REACT_EDITOR=code
# Relay API requests to your development server
- REACT_APP_QABOARD_API_HOST=http://backend:5152
- REACT_APP_QABOARD_HOST=http://proxy
# Don't relay requests to other containers via a proxy
- HTTP_PROXY=
- http_proxy=
# To avoid root-owned files in ./webapp: export QABOARD_DEV_USER="$(id -u):$(id -g)"
user: "${QABOARD_DEV_USER:-root}"
ports:
- "${QABOARD_DEV_FRONTEND_PORT:-3000}:3000"
depends_on:
- proxy
- backend
logging:
driver: json-file
website:
# The default target only has the built site
image: "${QABOARD_IMAGE:-ghcr.io/samsung/qaboard}:website-dev"
build:
target: dev
command: yarn start
volumes:
- ./website:/website
# the repository files the docs show (<RepoFile>) and the shot list, see website/Dockerfile
- ./charts:/charts:ro
- ./examples:/examples:ro
- ./docs-media/shots.yaml:/docs-media/shots.yaml:ro
- ./docs-media/standins:/docs-media/standins:ro
environment:
# to access the server from outside the docker environment
- HOST=0.0.0.0
- DANGEROUSLY_DISABLE_HOST_CHECK=true
# with SIRC's filesystem that doesn't send update events
- CHOKIDAR_USEPOLLING=true
# deployments/sirc/.envrc sets it to 0 to deal with broken proxies/certs
- NODE_TLS_REJECT_UNAUTHORIZED=${NODE_TLS_REJECT_UNAUTHORIZED:-1}
ports:
- 6051:3000