-
Notifications
You must be signed in to change notification settings - Fork 691
/
docker-compose.yml
95 lines (94 loc) · 3.76 KB
/
docker-compose.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
94
95
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
version: '3'
volumes:
m2:
services:
# This service is a workaround to set volume permissions so that they are correct for non-root user build
volume_perms:
image: alpine
command: "chown -R 1000:1000 /var/maven"
volumes:
- m2:/var/maven/.m2
# Build+test. Stops on first test failure
build:
image: "maven:3-eclipse-temurin-11"
profiles: ["build"]
command: ["-Duser.home=/var/maven", "-Pall-adapters", "-Dsurefire.useFile=false", "-DdisableXmlReport=true", "clean", "install"]
entrypoint: "mvn"
working_dir: /opt/project
user: 1000:1000
environment:
- MAVEN_OPTS=-Xmx768m -XX:ReservedCodeCacheSize=64m -Xss2048k
- MAVEN_CONFIG=/var/maven/.m2
volumes:
- m2:/var/maven/.m2
- .:/opt/project
depends_on:
- volume_perms
# Build+test. Does not stop on test failures
build-all:
image: "maven:3-eclipse-temurin-17"
profiles: ["build-all"]
command: ["--fail-at-end", "-Duser.home=/var/maven", "-Pall-adapters", "-Dsurefire.useFile=false", "-DdisableXmlReport=true", "clean", "install"]
entrypoint: "mvn"
working_dir: /opt/project
user: 1000:1000
ports:
- 5005:5005
environment:
- MAVEN_OPTS=-Xmx768m -XX:ReservedCodeCacheSize=64m -Xss2048k
- MAVEN_CONFIG=/var/maven/.m2
volumes:
- m2:/var/maven/.m2
- .:/opt/project
depends_on:
- volume_perms
# Just build (no tests)
build-quick:
image: "maven:3-eclipse-temurin-17"
profiles: ["build-quick"]
command: ["-Duser.home=/var/maven", "-Pquick", "-Dsurefire.useFile=false", "-DdisableXmlReport=true", "-DuniqueVersion=false", "-ff", "-Dassemble", "-DskipTests", "-DfailIfNoTests=false", "clean", "install"]
entrypoint: "mvn"
working_dir: /opt/project
user: 1000:1000
environment:
- MAVEN_OPTS=-Xmx768m -XX:ReservedCodeCacheSize=64m -Xss2048k
- MAVEN_CONFIG=/var/maven/.m2
volumes:
- m2:/var/maven/.m2
- .:/opt/project
depends_on:
- volume_perms
# Build+test. Waits for debugger on port 5005. Stops on first test failure
debug:
image: "maven:3-eclipse-temurin-17"
profiles: ["build-debug"]
command: ["-Duser.home=/var/maven", "-Pall-adapters", "-Dsurefire.useFile=false", "-DdisableXmlReport=true", "-Dopenejb.server.debug", "-Dmaven.surefire.debug", "-Dopenejb.arquillian.debug=true", "clean", "install"]
entrypoint: "mvn"
working_dir: /opt/project
user: 1000:1000
ports:
- 5005:5005
environment:
- MAVEN_OPTS=-Xmx768m -XX:ReservedCodeCacheSize=64m -Xss2048k
- MAVEN_CONFIG=/var/maven/.m2
volumes:
- m2:/var/maven/.m2
- .:/opt/project
depends_on:
- volume_perms