-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
105 lines (101 loc) · 4.08 KB
/
docker-compose.yml
File metadata and controls
105 lines (101 loc) · 4.08 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
services:
# Mail catcher for development/testing (provides SMTP server and web UI)
mailhog:
image: mailhog/mailhog:latest
container_name: treebase-mailhog
ports:
- "1025:1025" # SMTP server
- "8025:8025" # Web UI to view emails
# PostgreSQL database
postgres:
image: postgres:15
container_name: treebase-postgres
environment:
POSTGRES_DB: treebase
POSTGRES_USER: treebase
POSTGRES_PASSWORD: treebase
ports:
- "5432:5432"
volumes:
- postgres-data:/var/lib/postgresql/data
- ./docker/00-init-roles.sql:/docker-entrypoint-initdb.d/00-init-roles.sql
- ./treebase-core/src/main/resources/TBASE2_POSTGRES_CREATION.sql:/docker-entrypoint-initdb.d/01-schema.sql
- ./treebase-core/src/main/resources/initTreebase.sql:/docker-entrypoint-initdb.d/02-init.sql
- ./docker/03-migration-hibernate-sequence.sql:/docker-entrypoint-initdb.d/03-migration-hibernate-sequence.sql
healthcheck:
test: ["CMD-SHELL", "pg_isready -U treebase"]
interval: 10s
timeout: 5s
retries: 5
# TreeBASE web application (production)
web:
build:
context: .
dockerfile: Dockerfile
container_name: treebase-web
ports:
- "8080:8080"
depends_on:
postgres:
condition: service_healthy
environment:
# Database connection will be configured via context.xml
DB_HOST: postgres
DB_PORT: 5432
DB_NAME: treebase
DB_USER: treebase
DB_PASSWORD: treebase
volumes:
# Mount configuration for runtime updates
- ./docker/context.xml:/usr/local/tomcat/conf/Catalina/localhost/treebase-web.xml
profiles:
- production
# TreeBASE web application (development with JSP hot-reload)
web-dev:
build:
context: .
dockerfile: Dockerfile.dev
container_name: treebase-web-dev
ports:
- "8080:8080"
depends_on:
postgres:
condition: service_healthy
environment:
DB_HOST: postgres
DB_PORT: 5432
DB_NAME: treebase
DB_USER: treebase
DB_PASSWORD: treebase
volumes:
# Mount the entire project for building
- .:/app
- maven-repo:/root/.m2
# Mount configuration
- ./docker/context.xml:/usr/local/tomcat/conf/Catalina/localhost/treebase-web.xml
# Mount WEB-INF from built artifact (will be populated by entrypoint)
- web-inf-classes:/usr/local/tomcat/webapps/treebase-web/WEB-INF/classes
- web-inf-lib:/usr/local/tomcat/webapps/treebase-web/WEB-INF/lib
# Mount JSP and static files for live editing (excluding WEB-INF to preserve compiled classes and libs)
- ./treebase-web/src/main/webapp/decorators:/usr/local/tomcat/webapps/treebase-web/decorators
- ./treebase-web/src/main/webapp/images:/usr/local/tomcat/webapps/treebase-web/images
- ./treebase-web/src/main/webapp/scripts:/usr/local/tomcat/webapps/treebase-web/scripts
- ./treebase-web/src/main/webapp/styles:/usr/local/tomcat/webapps/treebase-web/styles
- ./treebase-web/src/main/webapp/common:/usr/local/tomcat/webapps/treebase-web/common
- ./treebase-web/src/main/webapp/help:/usr/local/tomcat/webapps/treebase-web/help
- ./treebase-web/src/main/webapp/test:/usr/local/tomcat/webapps/treebase-web/test
# Mount root-level JSP files
- ./treebase-web/src/main/webapp/index.jsp:/usr/local/tomcat/webapps/treebase-web/index.jsp
- ./treebase-web/src/main/webapp/login.jsp:/usr/local/tomcat/webapps/treebase-web/login.jsp
- ./treebase-web/src/main/webapp/logout.jsp:/usr/local/tomcat/webapps/treebase-web/logout.jsp
- ./treebase-web/src/main/webapp/error.jsp:/usr/local/tomcat/webapps/treebase-web/error.jsp
- ./treebase-web/src/main/webapp/error-403.jsp:/usr/local/tomcat/webapps/treebase-web/error-403.jsp
- ./treebase-web/src/main/webapp/error-404.jsp:/usr/local/tomcat/webapps/treebase-web/error-404.jsp
- ./treebase-web/src/main/webapp/error-500.jsp:/usr/local/tomcat/webapps/treebase-web/error-500.jsp
profiles:
- development
volumes:
postgres-data:
maven-repo:
web-inf-classes:
web-inf-lib: