Skip to content

Commit e602149

Browse files
author
Keon Amini
authored
feat: Create a docker-compose file for docker-supported datasources for dev testing (apache#4236)
1 parent dfdffb5 commit e602149

File tree

4 files changed

+117
-3
lines changed

4 files changed

+117
-3
lines changed

.licenserc.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ header:
3434
- '**/env.example'
3535
- '**/*.csv'
3636
- '**/*.json'
37+
- '**/*.sql'
3738
- '**/*.svg'
3839
- '**/*.png'
3940
- '.editorconfig'

backend/Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,6 @@ RUN apt-get update && \
133133
EXPOSE 8080
134134

135135
WORKDIR /app
136-
137136
# Setup Python
138137
COPY python/requirements.txt /app/requirements.txt
139138
RUN python3 -m pip install --no-cache --upgrade pip setuptools && \
@@ -156,8 +155,9 @@ COPY --from=build /app/resources/tap /app/resources/tap
156155

157156
ENV PATH="/app/bin:${PATH}"
158157

159-
# add tini, prevent zombie process
160-
RUN apt-get install -y tini
158+
RUN apt-get update && \
159+
apt-get install -y tini #add tini, prevent zombie process \
160+
161161
ENTRYPOINT ["/sbin/tini", "--"]
162162

163163
CMD ["lake"]
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
CREATE
2+
DATABASE IF NOT EXISTS bitbucket;
3+
alter
4+
database bitbucket character set utf8 collate utf8_bin;
5+
GRANT ALL PRIVILEGES ON bitbucket.* TO
6+
'merico';
7+
8+
CREATE
9+
DATABASE IF NOT EXISTS jira;
10+
alter
11+
database jira character set utf8 collate utf8_bin;
12+
GRANT ALL PRIVILEGES ON jira.* TO
13+
'merico';

docker-compose.datasources.yml

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one or more
2+
# contributor license agreements. See the NOTICE file distributed with
3+
# this work for additional information regarding copyright ownership.
4+
# The ASF licenses this file to You under the Apache License, Version 2.0
5+
# (the "License"); you may not use this file except in compliance with
6+
# the License. You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
17+
# This compose file is provided with the purposes of locally testing datasources that can be Dockerized.
18+
19+
version: "3"
20+
services:
21+
22+
mysql-ds:
23+
image: mysql:8
24+
volumes:
25+
- ./.docker/mysql-ds:/var/lib/mysql
26+
# init.sql only runs on bootstrap. If you want to manually add the extra databases, run the SQL statements in the init.sql as MySQL root user
27+
- ./backend/scripts/docker/mysql/init-ds.sql:/docker-entrypoint-initdb.d/init-ds.sql:ro
28+
restart: always
29+
ports:
30+
- "3406:3306"
31+
environment:
32+
MYSQL_ROOT_PASSWORD: admin
33+
MYSQL_USER: merico
34+
MYSQL_PASSWORD: merico
35+
36+
jenkins:
37+
image: jenkins/jenkins:2.387
38+
privileged: true
39+
user: root
40+
ports:
41+
- "8099:8080" # the UI
42+
- "50000:50000"
43+
container_name: jenkins
44+
volumes:
45+
- ./.docker/jenkins:/var/jenkins_home
46+
47+
# see https://developer.atlassian.com/platform/marketplace/timebomb-licenses-for-testing-server-apps/ for temporary test licenses
48+
jira:
49+
image: atlassian/jira-software:9.5.0
50+
volumes:
51+
- ./.docker/jira:/var/atlassian/jira
52+
#download this jar from https://dev.mysql.com/downloads/connector/j/8.0.html if needed
53+
- ./.docker/mysql-connector-j-8.0.32.jar:/opt/atlassian/jira/lib/mysql-connector-j-8.0.32.jar
54+
ports:
55+
- '8090:8080' # the UI
56+
environment:
57+
JIRA_DATABASE_URL: 'mysql://merico:merico@mysql-ds:3306/jira?autoReconnect=true&useSSL=false'
58+
JIRA_DB_PASSWORD: merico
59+
JVM_RESERVED_CODE_CACHE_SIZE: 1024m
60+
SETENV_JVM_MINIMUM_MEMORY: 2048m
61+
SETENV_JVM_MAXIMUM_MEMORY: 4096m
62+
# JIRA_PROXY_NAME:
63+
# JIRA_PROXY_PORT:
64+
# JIRA_PROXY_SCHEME:
65+
logging:
66+
# limit logs retained on host to 25MB
67+
driver: "json-file"
68+
options:
69+
max-size: "500k"
70+
max-file: "50"
71+
depends_on:
72+
- mysql-ds
73+
74+
# see https://developer.atlassian.com/platform/marketplace/timebomb-licenses-for-testing-server-apps/ for temporary test licenses
75+
bitbucket:
76+
image: atlassian/bitbucket-server:8.7.0
77+
ports:
78+
- "7990:7990" # the UI
79+
- "7999:7999"
80+
environment:
81+
# SERVER_PROXY_NAME:
82+
# SERVER_PROXY_PORT:
83+
SERVER_SCHEME: http
84+
SERVER_SECURE: false
85+
JVM_MINIMUM_MEMORY: 512m
86+
JVM_MAXIMUM_MEMORY: 1024m
87+
# JVM_SUPPORTED_RECOMMENDED_ARGS: NONE
88+
SEARCH_ENABLED: true
89+
APPLICATION_MODE: default
90+
JDBC_DRIVER: com.mysql.cj.jdbc.Driver
91+
JDBC_URL: 'jdbc:mysql://merico:merico@mysql-ds:3306/bitbucket?allowPublicKeyRetrieval=true&autoReconnect=true&useSSL=false'
92+
JDBC_USER: merico
93+
JDBC_PASSWORD: merico
94+
volumes:
95+
#download this jar from https://dev.mysql.com/downloads/connector/j/8.0.html if needed
96+
- ./.docker/mysql-connector-j-8.0.32.jar:/var/atlassian/application-data/bitbucket/lib/mysql-connector-j-8.0.32.jar
97+
- ./.docker/bitbucket/lib/native:/var/atlassian/application-data/bitbucket/lib/native
98+
- ./.docker/bitbucket:/var/atlassian/application-data/bitbucket
99+
depends_on:
100+
- mysql-ds

0 commit comments

Comments
 (0)