forked from sofastack/sofa-dashboard
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[sofastack#19] Docker image built support
- Loading branch information
Showing
7 changed files
with
185 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
version: '2' | ||
|
||
services: | ||
sofa-dashboard-quick-start: | ||
image: sofastack/sofa-dashboard-web:1.0.0-SNAPSHOT | ||
container_name: sofa-dashboard-quick-start | ||
depends_on: | ||
- sofa-dashboard-db | ||
- sofa-dashboard-zk | ||
ports: | ||
- "8080:8080" | ||
links: | ||
- sofa-dashboard-zk | ||
- sofa-dashboard-db | ||
|
||
sofa-dashboard-zk: | ||
image: zookeeper:3.4.14 | ||
container_name: sofa-dashboard-zk | ||
environment: | ||
ZOO_MY_ID: 1 | ||
ZOO_SERVERS: server.1=0.0.0.0:2888:3888 | ||
ports: | ||
- "2181:2181" | ||
|
||
sofa-dashboard-db: | ||
image: mysql:5.7 | ||
container_name: sofa-dashboard-db | ||
environment: | ||
TZ: Asia/Shanghai | ||
MYSQL_ALLOW_EMPTY_PASSWORD: 'yes' | ||
depends_on: | ||
- sofa-dashboard-dbdata | ||
ports: | ||
- "3306:3306" | ||
volumes: | ||
- ../../sql:/docker-entrypoint-initdb.d | ||
volumes_from: | ||
- sofa-dashboard-dbdata | ||
|
||
sofa-dashboard-dbdata: | ||
image: alpine:latest | ||
container_name: sofa-dashboard-dbdata | ||
volumes: | ||
- /var/lib/mysql |
10 changes: 10 additions & 0 deletions
10
sofa-dashboard-backend/sofa-dashboard-web/docker/Dockerfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
FROM openjdk:8 | ||
|
||
WORKDIR /root | ||
|
||
ADD sofa-dashboard-web-latest.jar /root/ | ||
|
||
EXPOSE 8080 | ||
|
||
CMD java -jar sofa-dashboard-web-latest.jar \ | ||
--spring.profiles.active=docker |
19 changes: 19 additions & 0 deletions
19
sofa-dashboard-backend/sofa-dashboard-web/docker/build-docker.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/bash | ||
|
||
echo | ||
echo '--- Build SOFA-Dashboard Docker image ---' | ||
echo " DOCKER_BUILD_DIR=${DOCKER_BUILD_DIR}" | ||
echo " DOCKER_IMG_NAME=${DOCKER_IMG_NAME}" | ||
echo " SCRIPTS_DIR=${SCRIPTS_DIR}" | ||
echo " ARTIFACT_JAR=${ARTIFACT_JAR}" | ||
echo | ||
|
||
# Re-create build context | ||
rm -rf ${DOCKER_BUILD_DIR} && mkdir -p ${DOCKER_BUILD_DIR} | ||
|
||
# Copy artifact resources | ||
cp -r ${SCRIPTS_DIR}/* ${DOCKER_BUILD_DIR} | ||
cp ${ARTIFACT_JAR} ${DOCKER_BUILD_DIR}/sofa-dashboard-web-latest.jar | ||
|
||
|
||
docker build ${DOCKER_BUILD_DIR} -t ${DOCKER_IMG_NAME} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
sofa-dashboard-backend/sofa-dashboard-web/src/main/resources/application-docker.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
server.port=8080 | ||
# ark 管控端配置中心地址 | ||
com.alipay.sofa.dashboard.zookeeper.address=sofa-dashboard-zk:2181 | ||
# mysql 数据库连接属性配置 | ||
spring.datasource.url=jdbc:mysql://sofa-dashboard-db:3306/SofaDashboardDB | ||
spring.datasource.username=root | ||
spring.datasource.password= | ||
# zookeeper 注册中心地址 | ||
com.alipay.sofa.dashboard.registry=zookeeper://sofa-dashboard-zk:2181 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters