-
-
Notifications
You must be signed in to change notification settings - Fork 339
/
docker-compose.dev.yml
93 lines (92 loc) · 3.03 KB
/
docker-compose.dev.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
version: "3.9"
services:
# Mathesar App built with the same configurations as the production image
# but with additional testing dependencies.
# It is used to run automated test cases to verify if the app works as intended
dev-db-base:
command: ["postgres", "-c", "shared_preload_libraries=plugin_debugger"]
build:
context: .
dockerfile: Dockerfile.devdb
args:
PG_VERSION: ${PG_VERSION-13}
environment:
- PG_VERSION=${PG_VERSION-13}
- POSTGRES_DB=mathesar_django
- POSTGRES_USER=mathesar
- POSTGRES_PASSWORD=mathesar
healthcheck:
test: [ "CMD-SHELL", "pg_isready -d $${POSTGRES_DB-mathesar_django} -U $${POSTGRES_USER-mathesar}"]
interval: 5s
timeout: 1s
retries: 30
start_period: 5s
dev-db:
container_name: mathesar_dev_db
extends:
service: dev-db-base
ports:
- "5432:5432"
volumes:
- dev_postgres_data:/var/lib/postgresql/data
- ./db/sql:/sql/
# A Django development webserver + Svelte development server used when developing Mathesar.
# The code changes are hot reloaded and debug flags are enabled to aid developers working on Mathesar.
# It is not recommended to use this service in production environment.
dev-service:
container_name: mathesar_service_dev
image: mathesar/mathesar-dev:latest
build:
context: .
target: development
dockerfile: Dockerfile
args:
PYTHON_VERSION: ${PYTHON_VERSION-3.9-bookworm}
environment:
- MODE=${MODE-DEVELOPMENT}
- DEBUG=${DEBUG-True}
- DJANGO_SETTINGS_MODULE=${DJANGO_SETTINGS_MODULE-config.settings.development}
- ALLOWED_HOSTS=${ALLOWED_HOSTS-*}
- SECRET_KEY=${SECRET_KEY}
- MATHESAR_ANALYTICS_URL=${MATHESAR_ANALYTICS_URL-https://example.com}
- MATHESAR_DATABASES=(mathesar_tables|postgresql://mathesar:mathesar@mathesar_dev_db:5432/mathesar)
- DJANGO_SUPERUSER_PASSWORD=password
- POSTGRES_DB=mathesar_django
- POSTGRES_USER=mathesar
- POSTGRES_PASSWORD=mathesar
- POSTGRES_HOST=mathesar_dev_db
- POSTGRES_PORT=5432
volumes:
- .:/code/
- ui_node_modules:/code/mathesar_ui/node_modules/
depends_on:
dev-db:
condition: service_healthy
# On dev, following ports are exposed to other containers, and the host.
ports:
- "8000:8000"
- "3000:3000"
- "6006:6006"
test-service:
container_name: mathesar_service_test
image: mathesar/mathesar-test:latest
environment:
- MATHESAR_DATABASES=(mathesar_tables|postgresql://mathesar:mathesar@mathesar_dev_db:5432/mathesar)
- POSTGRES_DB=mathesar_django
- POSTGRES_USER=mathesar
- POSTGRES_PASSWORD=mathesar
- POSTGRES_HOST=mathesar_dev_db
- POSTGRES_PORT=5432
build:
context: .
target: ${TARGET-testing}
dockerfile: Dockerfile
args:
PYTHON_VERSION: ${PYTHON_VERSION-3.9-bookworm}
depends_on:
- dev-db
ports:
- "8000:8000"
volumes:
ui_node_modules:
dev_postgres_data: