Skip to content

Commit

Permalink
feat: add docker deploy support for dubbo-sample-shop example
Browse files Browse the repository at this point in the history
Signed-off-by: yuluo-yx <[email protected]>
  • Loading branch information
yuluo-yx committed Jun 1, 2024
1 parent 0366886 commit 9a1afa3
Show file tree
Hide file tree
Showing 39 changed files with 900 additions and 4 deletions.
28 changes: 28 additions & 0 deletions dubbo-samples-shop/docker-deploy/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
APP_HOME=/dubbo/shop/
CONTAINER_PREFIX=dubbo-shop-

MYSQL_PORT=3306
MYSQL_VERSION=8.0.31
MYSQL_INNER_PORT=3306
MYSQL_DATABASE=test_shop
MYSQL_ROOT_PASSWORD=TOOR

NACOS_PORT=8848
NACOS_VERSION=v2.3.0
NACOS_GRPC_PORT=9848
NACOS_INNER_PORT=8848
NACOS_INNER_GRPC_PORT=9848

NGINX_PORT=80
NGINX_INNER_PORT=80
NGINX_VERSION:latest



WEB_ADS=8080
WEB_ADS_APPS=./apps/web/ads
WEB_DUBBO_PROTOCOL=20888
SERVICE_ADS=8083
SERVICE_ADS_APPS=./apps/service/ads
SERVICE_DUBBO_PROTOCOL=20887

2 changes: 2 additions & 0 deletions dubbo-samples-shop/docker-deploy/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
**/*.jar
/nginx/html/dist/
14 changes: 14 additions & 0 deletions dubbo-samples-shop/docker-deploy/apps/service/ads/DockerFile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM registry.cn-hangzhou.aliyuncs.com/yuluo-yx/java-base:V20240116 as builder

LABEL author="yuluo" \
email="[email protected]"

ARG APP_HOME
ARG SERVICE_ADS_APPS

WORKDIR ${APP_HOME}

COPY ${SERVICE_ADS_APPS}/app.jar app.jar
COPY ${SERVICE_ADS_APPS}/application-docker.yml application-docker.yml

ENTRYPOINT ["java", "-jar", "app.jar", "--spring.profiles.active=docker"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# 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.
server:
port: 8083
spring:
application:

name: AdsServiceImpl

datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://dubbo-shop-mysql:3306/test_shop
username: root
password: root
dubbo:
application:
logger: slf4j
name: ${spring.application.name}
qos-enable: false
check-serializable: false
registry:
address: nacos://dubbo-shop-nacos:8848?username=nacos&password=nacos
protocol:
port: 20887
name: dubbo
12 changes: 12 additions & 0 deletions dubbo-samples-shop/docker-deploy/apps/service/checkout/DockerFile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM registry.cn-hangzhou.aliyuncs.com/yuluo-yx/java-base:V20240116 as builder

LABEL author="yuluo" \
email="[email protected]"

ARG APP_HOME

VOLUME ${APP_HOME}

WORKDIR ${APP_HOME}

ENTRYPOINT ["java", "-jar", "app.jar", "--spring.profiles.active=docker"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# 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.
12 changes: 12 additions & 0 deletions dubbo-samples-shop/docker-deploy/apps/service/goods/DockerFile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM registry.cn-hangzhou.aliyuncs.com/yuluo-yx/java-base:V20240116 as builder

LABEL author="yuluo" \
email="[email protected]"

ARG APP_HOME

VOLUME ${APP_HOME}

WORKDIR ${APP_HOME}

ENTRYPOINT ["java", "-jar", "app.jar", "--spring.profiles.active=docker"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# 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.
12 changes: 12 additions & 0 deletions dubbo-samples-shop/docker-deploy/apps/service/hotGoods/DockerFile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM registry.cn-hangzhou.aliyuncs.com/yuluo-yx/java-base:V20240116 as builder

LABEL author="yuluo" \
email="[email protected]"

ARG APP_HOME

VOLUME ${APP_HOME}

WORKDIR ${APP_HOME}

ENTRYPOINT ["java", "-jar", "app.jar", "--spring.profiles.active=docker"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# 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.
12 changes: 12 additions & 0 deletions dubbo-samples-shop/docker-deploy/apps/service/newGoods/DockerFile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM registry.cn-hangzhou.aliyuncs.com/yuluo-yx/java-base:V20240116 as builder

LABEL author="yuluo" \
email="[email protected]"

ARG APP_HOME

VOLUME ${APP_HOME}

WORKDIR ${APP_HOME}

ENTRYPOINT ["java", "-jar", "app.jar", "--spring.profiles.active=docker"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# 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.
14 changes: 14 additions & 0 deletions dubbo-samples-shop/docker-deploy/apps/web/ads/DockerFile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM registry.cn-hangzhou.aliyuncs.com/yuluo-yx/java-base:V20240116 as builder

LABEL author="yuluo" \
email="[email protected]"

ARG APP_HOME
ARG WEB_ADS_APPS

WORKDIR ${APP_HOME}

COPY ${WEB_ADS_APPS}/app.jar app.jar
COPY ${WEB_ADS_APPS}/application-docker.yml application-docker.yml

ENTRYPOINT ["java", "-jar", "app.jar", "--spring.profiles.active=docker"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# 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.
server:
port: 50003

dubbo:
application:
logger: slf4j
qos-enable: false
check-serializable: false
registry:
address: nacos://dubbo-shop-nacos:8848?username=nacos&password=nacos
protocol:
port: 20888
name: dubbo
12 changes: 12 additions & 0 deletions dubbo-samples-shop/docker-deploy/apps/web/checkout/DockerFile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM registry.cn-hangzhou.aliyuncs.com/yuluo-yx/java-base:V20240116 as builder

LABEL author="yuluo" \
email="[email protected]"

ARG APP_HOME

VOLUME ${APP_HOME}

WORKDIR ${APP_HOME}

ENTRYPOINT ["java", "-jar", "app.jar", "--spring.profiles.active=docker"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# 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.
12 changes: 12 additions & 0 deletions dubbo-samples-shop/docker-deploy/apps/web/goods/DockerFile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM registry.cn-hangzhou.aliyuncs.com/yuluo-yx/java-base:V20240116 as builder

LABEL author="yuluo" \
email="[email protected]"

ARG APP_HOME

VOLUME ${APP_HOME}

WORKDIR ${APP_HOME}

ENTRYPOINT ["java", "-jar", "app.jar", "--spring.profiles.active=docker"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# 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.
12 changes: 12 additions & 0 deletions dubbo-samples-shop/docker-deploy/apps/web/hotGoods/DockerFile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM registry.cn-hangzhou.aliyuncs.com/yuluo-yx/java-base:V20240116 as builder

LABEL author="yuluo" \
email="[email protected]"

ARG APP_HOME

VOLUME ${APP_HOME}

WORKDIR ${APP_HOME}

ENTRYPOINT ["java", "-jar", "app.jar", "--spring.profiles.active=docker"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# 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.
12 changes: 12 additions & 0 deletions dubbo-samples-shop/docker-deploy/apps/web/newGoods/DockerFile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM registry.cn-hangzhou.aliyuncs.com/yuluo-yx/java-base:V20240116 as builder

LABEL author="yuluo" \
email="[email protected]"

ARG APP_HOME

VOLUME ${APP_HOME}

WORKDIR ${APP_HOME}

ENTRYPOINT ["java", "-jar", "app.jar", "--spring.profiles.active=docker"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# 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.
Loading

0 comments on commit 9a1afa3

Please sign in to comment.