diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 000000000..70a0dde0b --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +* text=auto +*.sh text eol=lf diff --git a/.gitignore b/.gitignore index 698696d4b..ebbc753d3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ .idea +.vscode *.dat *.original *.lst @@ -33,3 +34,6 @@ ENV/ env.bak/ venv.bak/ +deployment/kubernetes-manifests/quickstart-k8s/yamls/deploy.yaml +deployment/kubernetes-manifests/quickstart-k8s/yamls/secret.yaml +deployment/kubernetes-manifests/quickstart-k8s/yamls/sw_deploy.yaml diff --git a/Makefile b/Makefile index 24ceab756..ff71610c2 100644 --- a/Makefile +++ b/Makefile @@ -1,18 +1,14 @@ # Codewisdom Train-Ticket system Repo=codewisdom -Tag=latest +Tag=1.0.1 Namespace="default" DeployArgs="" # build image .PHONY: build -build: clean-image package build-image - -.PHONY: package -package: - @mvn clean package -Dmaven.test.skip=true +build: clean-image build-image .PHONY: build-image build-image: @@ -27,14 +23,18 @@ push-image: publish-image: @script/publish-docker-images.sh $(Repo) $(Tag) +# deploy from source +.PHONY: deploy +deploy: build deploy-no-build + # deploy # DeployArgs "" : deploy train-ticket with all-in-one mysql cluster # DeployArgs "--independent-db" : deploy train-ticket with mysql cluster each service # DeployArgs "--with-monitoring" : deploy train-ticket with prometheus # DeployArgs "--with-tracing" : deploy train-ticket with skywalking # DeployArgs "--all" : deploy train-ticket with mysql cluster each service -.PHONY: deploy -deploy: +.PHONY: deploy-no-build +deploy-no-build: @hack/deploy/deploy.sh $(Namespace) "$(DeployArgs)" # deploy diff --git a/deployment/kubernetes-manifests/quickstart-k8s/charts/mysql/Chart.yaml b/deployment/kubernetes-manifests/quickstart-k8s/charts/mysql/Chart.yaml index c9b10c7f6..f8265ce16 100644 --- a/deployment/kubernetes-manifests/quickstart-k8s/charts/mysql/Chart.yaml +++ b/deployment/kubernetes-manifests/quickstart-k8s/charts/mysql/Chart.yaml @@ -16,7 +16,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 1.0.0 +version: 1.0.1 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/deployment/kubernetes-manifests/quickstart-k8s/yamls/deploy.yaml.sample b/deployment/kubernetes-manifests/quickstart-k8s/yamls/deploy.yaml.sample index 89aa4c889..79ea0549e 100644 --- a/deployment/kubernetes-manifests/quickstart-k8s/yamls/deploy.yaml.sample +++ b/deployment/kubernetes-manifests/quickstart-k8s/yamls/deploy.yaml.sample @@ -14,7 +14,7 @@ spec: spec: containers: - name: ts-admin-basic-info-service - image: codewisdom/ts-admin-basic-info-service:1.0.0 + image: codewisdom/ts-admin-basic-info-service:1.0.1 imagePullPolicy: IfNotPresent env: - name: NODE_IP @@ -98,7 +98,7 @@ spec: spec: containers: - name: ts-admin-route-service - image: codewisdom/ts-admin-route-service:1.0.0 + image: codewisdom/ts-admin-route-service:1.0.1 imagePullPolicy: IfNotPresent env: - name: NODE_IP @@ -140,7 +140,7 @@ spec: spec: containers: - name: ts-admin-travel-service - image: codewisdom/ts-admin-travel-service:1.0.0 + image: codewisdom/ts-admin-travel-service:1.0.1 imagePullPolicy: IfNotPresent env: - name: NODE_IP @@ -224,7 +224,7 @@ spec: spec: containers: - name: ts-assurance-service - image: codewisdom/ts-assurance-service:1.0.0 + image: codewisdom/ts-assurance-service:1.0.1 imagePullPolicy: IfNotPresent env: - name: NODE_IP @@ -268,7 +268,7 @@ spec: spec: containers: - name: ts-auth-service - image: codewisdom/ts-auth-service:1.0.0 + image: codewisdom/ts-auth-service:1.0.1 imagePullPolicy: IfNotPresent env: - name: NODE_IP @@ -354,7 +354,7 @@ spec: spec: containers: - name: ts-basic-service - image: codewisdom/ts-basic-service:1.0.0 + image: codewisdom/ts-basic-service:1.0.1 imagePullPolicy: IfNotPresent env: - name: NODE_IP @@ -396,7 +396,7 @@ spec: spec: containers: - name: ts-cancel-service - image: codewisdom/ts-cancel-service:1.0.0 + image: codewisdom/ts-cancel-service:1.0.1 imagePullPolicy: IfNotPresent env: - name: NODE_IP @@ -438,7 +438,7 @@ spec: spec: containers: - name: ts-config-service - image: codewisdom/ts-config-service:1.0.0 + image: codewisdom/ts-config-service:1.0.1 imagePullPolicy: IfNotPresent env: - name: NODE_IP @@ -482,7 +482,7 @@ spec: spec: containers: - name: ts-consign-price-service - image: codewisdom/ts-consign-price-service:1.0.0 + image: codewisdom/ts-consign-price-service:1.0.1 imagePullPolicy: IfNotPresent env: - name: NODE_IP @@ -570,7 +570,7 @@ spec: spec: containers: - name: ts-contacts-service - image: codewisdom/ts-contacts-service:1.0.0 + image: codewisdom/ts-contacts-service:1.0.1 imagePullPolicy: IfNotPresent env: - name: NODE_IP @@ -614,7 +614,7 @@ spec: spec: containers: - name: ts-delivery-service - image: codewisdom/ts-delivery-service:1.0.0 + image: codewisdom/ts-delivery-service:1.0.1 imagePullPolicy: IfNotPresent env: - name: NODE_IP @@ -660,7 +660,7 @@ spec: spec: containers: - name: ts-execute-service - image: codewisdom/ts-execute-service:1.0.0 + image: codewisdom/ts-execute-service:1.0.1 imagePullPolicy: IfNotPresent env: - name: NODE_IP @@ -702,7 +702,7 @@ spec: spec: containers: - name: ts-food-service - image: codewisdom/ts-food-service:1.0.0 + image: codewisdom/ts-food-service:1.0.1 imagePullPolicy: IfNotPresent env: - name: NODE_IP @@ -748,7 +748,7 @@ spec: spec: containers: - name: ts-food-delivery-service - image: codewisdom/ts-food-delivery-service:1.0.0 + image: codewisdom/ts-food-delivery-service:1.0.1 imagePullPolicy: IfNotPresent env: - name: NODE_IP @@ -792,7 +792,7 @@ spec: spec: containers: - name: ts-gateway-service - image: codewisdom/ts-gateway-service:1.0.0 + image: codewisdom/ts-gateway-service:1.0.1 imagePullPolicy: IfNotPresent env: - name: NODE_IP @@ -834,7 +834,7 @@ spec: spec: containers: - name: ts-inside-payment-service - image: codewisdom/ts-inside-payment-service:1.0.0 + image: codewisdom/ts-inside-payment-service:1.0.1 imagePullPolicy: IfNotPresent env: - name: NODE_IP @@ -878,7 +878,7 @@ spec: spec: containers: - name: ts-news-service - image: codewisdom/ts-news-service:1.0.0 + image: codewisdom/ts-news-service:1.0.1 imagePullPolicy: IfNotPresent env: - name: NODE_IP @@ -920,7 +920,7 @@ spec: spec: containers: - name: ts-notification-service - image: codewisdom/ts-notification-service:1.0.0 + image: codewisdom/ts-notification-service:1.0.1 imagePullPolicy: IfNotPresent env: - name: NODE_IP @@ -1058,7 +1058,7 @@ spec: spec: containers: - name: ts-payment-service - image: codewisdom/ts-payment-service:1.0.0 + image: codewisdom/ts-payment-service:1.0.1 imagePullPolicy: IfNotPresent env: - name: NODE_IP @@ -1102,7 +1102,7 @@ spec: spec: containers: - name: ts-preserve-other-service - image: codewisdom/ts-preserve-other-service:1.0.0 + image: codewisdom/ts-preserve-other-service:1.0.1 imagePullPolicy: IfNotPresent env: - name: NODE_IP @@ -1146,7 +1146,7 @@ spec: spec: containers: - name: ts-preserve-service - image: codewisdom/ts-preserve-service:1.0.0 + image: codewisdom/ts-preserve-service:1.0.1 imagePullPolicy: IfNotPresent env: - name: NODE_IP @@ -1190,7 +1190,7 @@ spec: spec: containers: - name: ts-price-service - image: codewisdom/ts-price-service:1.0.0 + image: codewisdom/ts-price-service:1.0.1 imagePullPolicy: IfNotPresent env: - name: NODE_IP @@ -1278,7 +1278,7 @@ spec: spec: containers: - name: ts-route-plan-service - image: codewisdom/ts-route-plan-service:1.0.0 + image: codewisdom/ts-route-plan-service:1.0.1 imagePullPolicy: IfNotPresent env: - name: NODE_IP @@ -1320,7 +1320,7 @@ spec: spec: containers: - name: ts-route-service - image: codewisdom/ts-route-service:1.0.0 + image: codewisdom/ts-route-service:1.0.1 imagePullPolicy: IfNotPresent env: - name: NODE_IP @@ -1364,7 +1364,7 @@ spec: spec: containers: - name: ts-seat-service - image: codewisdom/ts-seat-service:1.0.0 + image: codewisdom/ts-seat-service:1.0.1 imagePullPolicy: IfNotPresent env: - name: NODE_IP @@ -1406,7 +1406,7 @@ spec: spec: containers: - name: ts-security-service - image: codewisdom/ts-security-service:1.0.0 + image: codewisdom/ts-security-service:1.0.1 imagePullPolicy: IfNotPresent env: - name: NODE_IP @@ -1450,7 +1450,7 @@ spec: spec: containers: - name: ts-station-food-service - image: codewisdom/ts-station-food-service:1.0.0 + image: codewisdom/ts-station-food-service:1.0.1 imagePullPolicy: IfNotPresent env: - name: NODE_IP @@ -1538,7 +1538,7 @@ spec: spec: containers: - name: ts-ticket-office-service - image: codewisdom/ts-ticket-office-service:1.0.0 + image: codewisdom/ts-ticket-office-service:1.0.1 imagePullPolicy: IfNotPresent env: - name: NODE_IP @@ -1582,7 +1582,7 @@ spec: spec: containers: - name: ts-train-food-service - image: codewisdom/ts-train-food-service:1.0.0 + image: codewisdom/ts-train-food-service:1.0.1 imagePullPolicy: IfNotPresent env: - name: NODE_IP @@ -1626,7 +1626,7 @@ spec: spec: containers: - name: ts-train-service - image: codewisdom/ts-train-service:1.0.0 + image: codewisdom/ts-train-service:1.0.1 imagePullPolicy: IfNotPresent env: - name: NODE_IP @@ -1670,7 +1670,7 @@ spec: spec: containers: - name: ts-travel-plan-service - image: codewisdom/ts-travel-plan-service:1.0.0 + image: codewisdom/ts-travel-plan-service:1.0.1 imagePullPolicy: IfNotPresent env: - name: NODE_IP @@ -1712,7 +1712,7 @@ spec: spec: containers: - name: ts-travel-service - image: codewisdom/ts-travel-service:1.0.0 + image: codewisdom/ts-travel-service:1.0.1 imagePullPolicy: IfNotPresent env: - name: NODE_IP @@ -1756,7 +1756,7 @@ spec: spec: containers: - name: ts-travel2-service - image: codewisdom/ts-travel2-service:1.0.0 + image: codewisdom/ts-travel2-service:1.0.1 imagePullPolicy: IfNotPresent env: - name: NODE_IP @@ -1844,7 +1844,7 @@ spec: spec: containers: - name: ts-verification-code-service - image: codewisdom/ts-verification-code-service:1.0.0 + image: codewisdom/ts-verification-code-service:1.0.1 imagePullPolicy: IfNotPresent env: - name: NODE_IP @@ -1886,7 +1886,7 @@ spec: spec: containers: - name: ts-voucher-service - image: codewisdom/ts-voucher-service:1.0.0 + image: codewisdom/ts-voucher-service:1.0.1 imagePullPolicy: IfNotPresent env: - name: NODE_IP diff --git a/deployment/kubernetes-manifests/quickstart-k8s/yamls/sw_deploy.yaml.sample b/deployment/kubernetes-manifests/quickstart-k8s/yamls/sw_deploy.yaml.sample index 13764f16b..a0a94ae8b 100644 --- a/deployment/kubernetes-manifests/quickstart-k8s/yamls/sw_deploy.yaml.sample +++ b/deployment/kubernetes-manifests/quickstart-k8s/yamls/sw_deploy.yaml.sample @@ -25,7 +25,7 @@ spec: args: [ "-c", "cp -R /skywalking/agent /agent/" ] containers: - name: ts-admin-basic-info-service - image: codewisdom/ts-admin-basic-info-service:1.0.0 + image: codewisdom/ts-admin-basic-info-service:1.0.1 imagePullPolicy: IfNotPresent volumeMounts: - name: skywalking-agent @@ -161,7 +161,7 @@ spec: args: [ "-c", "cp -R /skywalking/agent /agent/" ] containers: - name: ts-admin-route-service - image: codewisdom/ts-admin-route-service:1.0.0 + image: codewisdom/ts-admin-route-service:1.0.1 imagePullPolicy: IfNotPresent volumeMounts: - name: skywalking-agent @@ -229,7 +229,7 @@ spec: args: [ "-c", "cp -R /skywalking/agent /agent/" ] containers: - name: ts-admin-travel-service - image: codewisdom/ts-admin-travel-service:1.0.0 + image: codewisdom/ts-admin-travel-service:1.0.1 imagePullPolicy: IfNotPresent volumeMounts: - name: skywalking-agent @@ -365,7 +365,7 @@ spec: args: [ "-c", "cp -R /skywalking/agent /agent/" ] containers: - name: ts-assurance-service - image: codewisdom/ts-assurance-service:1.0.0 + image: codewisdom/ts-assurance-service:1.0.1 imagePullPolicy: IfNotPresent volumeMounts: - name: skywalking-agent @@ -435,7 +435,7 @@ spec: args: [ "-c", "cp -R /skywalking/agent /agent/" ] containers: - name: ts-auth-service - image: codewisdom/ts-auth-service:1.0.0 + image: codewisdom/ts-auth-service:1.0.1 imagePullPolicy: IfNotPresent volumeMounts: - name: skywalking-agent @@ -573,7 +573,7 @@ spec: args: [ "-c", "cp -R /skywalking/agent /agent/" ] containers: - name: ts-basic-service - image: codewisdom/ts-basic-service:1.0.0 + image: codewisdom/ts-basic-service:1.0.1 imagePullPolicy: IfNotPresent volumeMounts: - name: skywalking-agent @@ -641,7 +641,7 @@ spec: args: [ "-c", "cp -R /skywalking/agent /agent/" ] containers: - name: ts-cancel-service - image: codewisdom/ts-cancel-service:1.0.0 + image: codewisdom/ts-cancel-service:1.0.1 imagePullPolicy: IfNotPresent volumeMounts: - name: skywalking-agent @@ -709,7 +709,7 @@ spec: args: [ "-c", "cp -R /skywalking/agent /agent/" ] containers: - name: ts-config-service - image: codewisdom/ts-config-service:1.0.0 + image: codewisdom/ts-config-service:1.0.1 imagePullPolicy: IfNotPresent volumeMounts: - name: skywalking-agent @@ -779,7 +779,7 @@ spec: args: [ "-c", "cp -R /skywalking/agent /agent/" ] containers: - name: ts-consign-price-service - image: codewisdom/ts-consign-price-service:1.0.0 + image: codewisdom/ts-consign-price-service:1.0.1 imagePullPolicy: IfNotPresent volumeMounts: - name: skywalking-agent @@ -919,7 +919,7 @@ spec: args: [ "-c", "cp -R /skywalking/agent /agent/" ] containers: - name: ts-contacts-service - image: codewisdom/ts-contacts-service:1.0.0 + image: codewisdom/ts-contacts-service:1.0.1 imagePullPolicy: IfNotPresent volumeMounts: - name: skywalking-agent @@ -989,7 +989,7 @@ spec: args: [ "-c", "cp -R /skywalking/agent /agent/" ] containers: - name: ts-delivery-service - image: codewisdom/ts-delivery-service:1.0.0 + image: codewisdom/ts-delivery-service:1.0.1 imagePullPolicy: IfNotPresent volumeMounts: - name: skywalking-agent @@ -1061,7 +1061,7 @@ spec: args: [ "-c", "cp -R /skywalking/agent /agent/" ] containers: - name: ts-execute-service - image: codewisdom/ts-execute-service:1.0.0 + image: codewisdom/ts-execute-service:1.0.1 imagePullPolicy: IfNotPresent volumeMounts: - name: skywalking-agent @@ -1129,7 +1129,7 @@ spec: args: [ "-c", "cp -R /skywalking/agent /agent/" ] containers: - name: ts-food-delivery-service - image: codewisdom/ts-food-delivery-service:1.0.0 + image: codewisdom/ts-food-delivery-service:1.0.1 imagePullPolicy: IfNotPresent volumeMounts: - name: skywalking-agent @@ -1199,7 +1199,7 @@ spec: args: [ "-c", "cp -R /skywalking/agent /agent/" ] containers: - name: ts-food-service - image: codewisdom/ts-food-service:1.0.0 + image: codewisdom/ts-food-service:1.0.1 imagePullPolicy: IfNotPresent volumeMounts: - name: skywalking-agent @@ -1271,7 +1271,7 @@ spec: args: [ "-c", "cp -R /skywalking/agent /agent/" ] containers: - name: ts-gateway-service - image: codewisdom/ts-gateway-service:1.0.0 + image: codewisdom/ts-gateway-service:1.0.1 imagePullPolicy: IfNotPresent volumeMounts: - name: skywalking-agent @@ -1339,7 +1339,7 @@ spec: args: [ "-c", "cp -R /skywalking/agent /agent/" ] containers: - name: ts-inside-payment-service - image: codewisdom/ts-inside-payment-service:1.0.0 + image: codewisdom/ts-inside-payment-service:1.0.1 imagePullPolicy: IfNotPresent volumeMounts: - name: skywalking-agent @@ -1409,7 +1409,7 @@ spec: args: [ "-c", "cp -R /skywalking/agent /agent/" ] containers: - name: ts-news-service - image: codewisdom/ts-news-service:1.0.0 + image: codewisdom/ts-news-service:1.0.1 imagePullPolicy: IfNotPresent volumeMounts: - name: skywalking-agent @@ -1477,7 +1477,7 @@ spec: args: [ "-c", "cp -R /skywalking/agent /agent/" ] containers: - name: ts-notification-service - image: codewisdom/ts-notification-service:1.0.0 + image: codewisdom/ts-notification-service:1.0.1 imagePullPolicy: IfNotPresent volumeMounts: - name: skywalking-agent @@ -1693,7 +1693,7 @@ spec: args: [ "-c", "cp -R /skywalking/agent /agent/" ] containers: - name: ts-payment-service - image: codewisdom/ts-payment-service:1.0.0 + image: codewisdom/ts-payment-service:1.0.1 imagePullPolicy: IfNotPresent volumeMounts: - name: skywalking-agent @@ -1763,7 +1763,7 @@ spec: args: [ "-c", "cp -R /skywalking/agent /agent/" ] containers: - name: ts-preserve-other-service - image: codewisdom/ts-preserve-other-service:1.0.0 + image: codewisdom/ts-preserve-other-service:1.0.1 imagePullPolicy: IfNotPresent volumeMounts: - name: skywalking-agent @@ -1833,7 +1833,7 @@ spec: args: [ "-c", "cp -R /skywalking/agent /agent/" ] containers: - name: ts-preserve-service - image: codewisdom/ts-preserve-service:1.0.0 + image: codewisdom/ts-preserve-service:1.0.1 imagePullPolicy: IfNotPresent volumeMounts: - name: skywalking-agent @@ -1903,7 +1903,7 @@ spec: args: [ "-c", "cp -R /skywalking/agent /agent/" ] containers: - name: ts-price-service - image: codewisdom/ts-price-service:1.0.0 + image: codewisdom/ts-price-service:1.0.1 imagePullPolicy: IfNotPresent volumeMounts: - name: skywalking-agent @@ -2043,7 +2043,7 @@ spec: args: [ "-c", "cp -R /skywalking/agent /agent/" ] containers: - name: ts-route-plan-service - image: codewisdom/ts-route-plan-service:1.0.0 + image: codewisdom/ts-route-plan-service:1.0.1 imagePullPolicy: IfNotPresent volumeMounts: - name: skywalking-agent @@ -2111,7 +2111,7 @@ spec: args: [ "-c", "cp -R /skywalking/agent /agent/" ] containers: - name: ts-route-service - image: codewisdom/ts-route-service:1.0.0 + image: codewisdom/ts-route-service:1.0.1 imagePullPolicy: IfNotPresent volumeMounts: - name: skywalking-agent @@ -2181,7 +2181,7 @@ spec: args: [ "-c", "cp -R /skywalking/agent /agent/" ] containers: - name: ts-seat-service - image: codewisdom/ts-seat-service:1.0.0 + image: codewisdom/ts-seat-service:1.0.1 imagePullPolicy: IfNotPresent volumeMounts: - name: skywalking-agent @@ -2249,7 +2249,7 @@ spec: args: [ "-c", "cp -R /skywalking/agent /agent/" ] containers: - name: ts-security-service - image: codewisdom/ts-security-service:1.0.0 + image: codewisdom/ts-security-service:1.0.1 imagePullPolicy: IfNotPresent volumeMounts: - name: skywalking-agent @@ -2319,7 +2319,7 @@ spec: args: [ "-c", "cp -R /skywalking/agent /agent/" ] containers: - name: ts-station-food-service - image: codewisdom/ts-station-food-service:1.0.0 + image: codewisdom/ts-station-food-service:1.0.1 imagePullPolicy: IfNotPresent volumeMounts: - name: skywalking-agent @@ -2459,7 +2459,7 @@ spec: args: [ "-c", "cp -R /skywalking/agent /agent/" ] containers: - name: ts-ticket-office-service - image: codewisdom/ts-ticket-office-service:1.0.0 + image: codewisdom/ts-ticket-office-service:1.0.1 imagePullPolicy: IfNotPresent volumeMounts: - name: skywalking-agent @@ -2529,7 +2529,7 @@ spec: args: [ "-c", "cp -R /skywalking/agent /agent/" ] containers: - name: ts-train-food-service - image: codewisdom/ts-train-food-service:1.0.0 + image: codewisdom/ts-train-food-service:1.0.1 imagePullPolicy: IfNotPresent volumeMounts: - name: skywalking-agent @@ -2599,7 +2599,7 @@ spec: args: [ "-c", "cp -R /skywalking/agent /agent/" ] containers: - name: ts-train-service - image: codewisdom/ts-train-service:1.0.0 + image: codewisdom/ts-train-service:1.0.1 imagePullPolicy: IfNotPresent volumeMounts: - name: skywalking-agent @@ -2669,7 +2669,7 @@ spec: args: [ "-c", "cp -R /skywalking/agent /agent/" ] containers: - name: ts-travel-plan-service - image: codewisdom/ts-travel-plan-service:1.0.0 + image: codewisdom/ts-travel-plan-service:1.0.1 imagePullPolicy: IfNotPresent volumeMounts: - name: skywalking-agent @@ -2737,7 +2737,7 @@ spec: args: [ "-c", "cp -R /skywalking/agent /agent/" ] containers: - name: ts-travel-service - image: codewisdom/ts-travel-service:1.0.0 + image: codewisdom/ts-travel-service:1.0.1 imagePullPolicy: IfNotPresent volumeMounts: - name: skywalking-agent @@ -2807,7 +2807,7 @@ spec: args: [ "-c", "cp -R /skywalking/agent /agent/" ] containers: - name: ts-travel2-service - image: codewisdom/ts-travel2-service:1.0.0 + image: codewisdom/ts-travel2-service:1.0.1 imagePullPolicy: IfNotPresent volumeMounts: - name: skywalking-agent @@ -2947,7 +2947,7 @@ spec: args: [ "-c", "cp -R /skywalking/agent /agent/" ] containers: - name: ts-verification-code-service - image: codewisdom/ts-verification-code-service:1.0.0 + image: codewisdom/ts-verification-code-service:1.0.1 imagePullPolicy: IfNotPresent volumeMounts: - name: skywalking-agent @@ -3004,7 +3004,7 @@ spec: spec: containers: - name: ts-voucher-service - image: codewisdom/ts-voucher-service:1.0.0 + image: codewisdom/ts-voucher-service:1.0.1 imagePullPolicy: IfNotPresent env: - name: NODE_IP diff --git a/deployment/kubernetes-manifests/skywalking/es.yml b/deployment/kubernetes-manifests/skywalking/es.yml index c5c458e2d..71b4625f8 100644 --- a/deployment/kubernetes-manifests/skywalking/es.yml +++ b/deployment/kubernetes-manifests/skywalking/es.yml @@ -4,11 +4,13 @@ metadata: creationTimestamp: null name: elasticsearch spec: + type: NodePort ports: - name: db port: 9200 protocol: TCP targetPort: 9200 + nodePort: 30092 - name: transport port: 9300 protocol: TCP diff --git a/hack/build-image.sh b/hack/build-image.sh index f5fa56160..216765db8 100755 --- a/hack/build-image.sh +++ b/hack/build-image.sh @@ -8,7 +8,7 @@ for dir in ts-*; do if [[ -d $dir ]]; then if [[ -n $(ls "$dir" | grep -i Dockerfile) ]]; then echo "build ${dir}" - docker build -t "$1"/"${dir}" "$dir" + docker build -t "$1"/"${dir}" -f "${dir}/Dockerfile" "." docker tag "$1"/"${dir}":latest "$1"/"${dir}":"$2" fi fi diff --git a/script/publish-docker-images.sh b/script/publish-docker-images.sh index 4802a7ede..1970d1ead 100755 --- a/script/publish-docker-images.sh +++ b/script/publish-docker-images.sh @@ -9,7 +9,7 @@ for dir in ts-*; do if [[ -n $(ls "$dir" | grep -i Dockerfile) ]]; then echo "build ${dir}" # Must use `buildx` as docker build tool - docker build --push -t "$1"/"${dir}":"$2" "$dir" + docker build --push -t "$1"/"${dir}":"$2" -f "${dir}/Dockerfile" "." fi fi done diff --git a/ts-admin-basic-info-service/Dockerfile b/ts-admin-basic-info-service/Dockerfile index 3862d1c70..f6b1b7907 100644 --- a/ts-admin-basic-info-service/Dockerfile +++ b/ts-admin-basic-info-service/Dockerfile @@ -1,8 +1,30 @@ -FROM java:8-jre +From maven:3.9.1-eclipse-temurin-8 as build + +WORKDIR /app + +COPY pom.xml pom.xml +COPY ts-common/pom.xml ts-common/pom.xml +# Remove all modules except ts-common +RUN sed -i "/\(ts-common\)<\/module>/!{/.*<\/module>/d}" pom.xml +RUN mvn dependency:go-offline -B + +ARG SERVICE_NAME=ts-admin-basic-info-service +# Add $SERVICE_NAME module +RUN sed -i "/ts-common<\/module>/a $SERVICE_NAME" pom.xml +COPY $SERVICE_NAME/pom.xml $SERVICE_NAME/pom.xml + +COPY ts-common/src ./ts-common/src +COPY $SERVICE_NAME/src ./$SERVICE_NAME/src + +RUN mvn package -DskipTests + +FROM eclipse-temurin:8-jre +ARG SERVICE_NAME=ts-admin-basic-info-service +ENV SERVICE_NAME=$SERVICE_NAME RUN /bin/cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai' >/etc/timezone -ADD ./target/ts-admin-basic-info-service-1.0.jar /app/ -CMD ["java", "-Xmx200m", "-jar", "/app/ts-admin-basic-info-service-1.0.jar"] +COPY --from=build /app/$SERVICE_NAME/target/$SERVICE_NAME-1.0.jar /app/ +CMD java -Xmx200m -jar /app/$SERVICE_NAME-1.0.jar EXPOSE 18767 \ No newline at end of file diff --git a/ts-admin-basic-info-service/Dockerfile.dockerignore b/ts-admin-basic-info-service/Dockerfile.dockerignore new file mode 100644 index 000000000..5c86a6bab --- /dev/null +++ b/ts-admin-basic-info-service/Dockerfile.dockerignore @@ -0,0 +1,6 @@ +* +!/pom.xml +!/ts-common/pom.xml +!/ts-common/src +!/ts-admin-basic-info-service/pom.xml +!/ts-admin-basic-info-service/src diff --git a/ts-admin-order-service/Dockerfile b/ts-admin-order-service/Dockerfile index ce0b649b9..613b390cd 100644 --- a/ts-admin-order-service/Dockerfile +++ b/ts-admin-order-service/Dockerfile @@ -1,8 +1,30 @@ -FROM java:8-jre +From maven:3.9.1-eclipse-temurin-8 as build + +WORKDIR /app + +COPY pom.xml pom.xml +COPY ts-common/pom.xml ts-common/pom.xml +# Remove all modules except ts-common +RUN sed -i "/\(ts-common\)<\/module>/!{/.*<\/module>/d}" pom.xml +RUN mvn dependency:go-offline -B + +ARG SERVICE_NAME=ts-admin-order-service +# Add $SERVICE_NAME module +RUN sed -i "/ts-common<\/module>/a $SERVICE_NAME" pom.xml +COPY $SERVICE_NAME/pom.xml $SERVICE_NAME/pom.xml + +COPY ts-common/src ./ts-common/src +COPY $SERVICE_NAME/src ./$SERVICE_NAME/src + +RUN mvn package -DskipTests + +FROM eclipse-temurin:8-jre +ARG SERVICE_NAME=ts-admin-order-service +ENV SERVICE_NAME=$SERVICE_NAME RUN /bin/cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai' >/etc/timezone -ADD ./target/ts-admin-order-service-1.0.jar /app/ -CMD ["java", "-Xmx200m", "-jar", "/app/ts-admin-order-service-1.0.jar"] +COPY --from=build /app/$SERVICE_NAME/target/$SERVICE_NAME-1.0.jar /app/ +CMD java -Xmx200m -jar /app/$SERVICE_NAME-1.0.jar EXPOSE 16112 \ No newline at end of file diff --git a/ts-admin-order-service/Dockerfile.dockerignore b/ts-admin-order-service/Dockerfile.dockerignore new file mode 100644 index 000000000..eae07b622 --- /dev/null +++ b/ts-admin-order-service/Dockerfile.dockerignore @@ -0,0 +1,6 @@ +* +!/pom.xml +!/ts-common/pom.xml +!/ts-common/src +!/ts-admin-order-service/pom.xml +!/ts-admin-order-service/src diff --git a/ts-admin-route-service/Dockerfile b/ts-admin-route-service/Dockerfile index 0b818ba32..1acc197f5 100644 --- a/ts-admin-route-service/Dockerfile +++ b/ts-admin-route-service/Dockerfile @@ -1,8 +1,30 @@ -FROM java:8-jre +From maven:3.9.1-eclipse-temurin-8 as build + +WORKDIR /app + +COPY pom.xml pom.xml +COPY ts-common/pom.xml ts-common/pom.xml +# Remove all modules except ts-common +RUN sed -i "/\(ts-common\)<\/module>/!{/.*<\/module>/d}" pom.xml +RUN mvn dependency:go-offline -B + +ARG SERVICE_NAME=ts-admin-route-service +# Add $SERVICE_NAME module +RUN sed -i "/ts-common<\/module>/a $SERVICE_NAME" pom.xml +COPY $SERVICE_NAME/pom.xml $SERVICE_NAME/pom.xml + +COPY ts-common/src ./ts-common/src +COPY $SERVICE_NAME/src ./$SERVICE_NAME/src + +RUN mvn package -DskipTests + +FROM eclipse-temurin:8-jre +ARG SERVICE_NAME=ts-admin-route-service +ENV SERVICE_NAME=$SERVICE_NAME RUN /bin/cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai' >/etc/timezone -ADD ./target/ts-admin-route-service-1.0.jar /app/ -CMD ["java", "-Xmx200m", "-jar", "/app/ts-admin-route-service-1.0.jar"] +COPY --from=build /app/$SERVICE_NAME/target/$SERVICE_NAME-1.0.jar /app/ +CMD java -Xmx200m -jar /app/$SERVICE_NAME-1.0.jar EXPOSE 16113 \ No newline at end of file diff --git a/ts-admin-route-service/Dockerfile.dockerignore b/ts-admin-route-service/Dockerfile.dockerignore new file mode 100644 index 000000000..44de217cd --- /dev/null +++ b/ts-admin-route-service/Dockerfile.dockerignore @@ -0,0 +1,6 @@ +* +!/pom.xml +!/ts-common/pom.xml +!/ts-common/src +!/ts-admin-route-service/pom.xml +!/ts-admin-route-service/src diff --git a/ts-admin-travel-service/Dockerfile b/ts-admin-travel-service/Dockerfile index fd4044fd6..953599762 100644 --- a/ts-admin-travel-service/Dockerfile +++ b/ts-admin-travel-service/Dockerfile @@ -1,8 +1,30 @@ -FROM java:8-jre +From maven:3.9.1-eclipse-temurin-8 as build + +WORKDIR /app + +COPY pom.xml pom.xml +COPY ts-common/pom.xml ts-common/pom.xml +# Remove all modules except ts-common +RUN sed -i "/\(ts-common\)<\/module>/!{/.*<\/module>/d}" pom.xml +RUN mvn dependency:go-offline -B + +ARG SERVICE_NAME=ts-admin-travel-service +# Add $SERVICE_NAME module +RUN sed -i "/ts-common<\/module>/a $SERVICE_NAME" pom.xml +COPY $SERVICE_NAME/pom.xml $SERVICE_NAME/pom.xml + +COPY ts-common/src ./ts-common/src +COPY $SERVICE_NAME/src ./$SERVICE_NAME/src + +RUN mvn package -DskipTests + +FROM eclipse-temurin:8-jre +ARG SERVICE_NAME=ts-admin-travel-service +ENV SERVICE_NAME=$SERVICE_NAME RUN /bin/cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai' >/etc/timezone -ADD ./target/ts-admin-travel-service-1.0.jar /app/ -CMD ["java", "-Xmx200m", "-jar", "/app/ts-admin-travel-service-1.0.jar"] +COPY --from=build /app/$SERVICE_NAME/target/$SERVICE_NAME-1.0.jar /app/ +CMD java -Xmx200m -jar /app/$SERVICE_NAME-1.0.jar EXPOSE 16114 \ No newline at end of file diff --git a/ts-admin-travel-service/Dockerfile.dockerignore b/ts-admin-travel-service/Dockerfile.dockerignore new file mode 100644 index 000000000..b9a431705 --- /dev/null +++ b/ts-admin-travel-service/Dockerfile.dockerignore @@ -0,0 +1,6 @@ +* +!/pom.xml +!/ts-common/pom.xml +!/ts-common/src +!/ts-admin-travel-service/pom.xml +!/ts-admin-travel-service/src diff --git a/ts-admin-user-service/Dockerfile b/ts-admin-user-service/Dockerfile index 78d3dcd2f..6309f7c48 100644 --- a/ts-admin-user-service/Dockerfile +++ b/ts-admin-user-service/Dockerfile @@ -1,8 +1,30 @@ -FROM java:8-jre +From maven:3.9.1-eclipse-temurin-8 as build + +WORKDIR /app + +COPY pom.xml pom.xml +COPY ts-common/pom.xml ts-common/pom.xml +# Remove all modules except ts-common +RUN sed -i "/\(ts-common\)<\/module>/!{/.*<\/module>/d}" pom.xml +RUN mvn dependency:go-offline -B + +ARG SERVICE_NAME=ts-admin-user-service +# Add $SERVICE_NAME module +RUN sed -i "/ts-common<\/module>/a $SERVICE_NAME" pom.xml +COPY $SERVICE_NAME/pom.xml $SERVICE_NAME/pom.xml + +COPY ts-common/src ./ts-common/src +COPY $SERVICE_NAME/src ./$SERVICE_NAME/src + +RUN mvn package -DskipTests + +FROM eclipse-temurin:8-jre +ARG SERVICE_NAME=ts-admin-user-service +ENV SERVICE_NAME=$SERVICE_NAME RUN /bin/cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai' >/etc/timezone -ADD ./target/ts-admin-user-service-1.0.jar /app/ -CMD ["java", "-Xmx200m", "-jar", "/app/ts-admin-user-service-1.0.jar"] +COPY --from=build /app/$SERVICE_NAME/target/$SERVICE_NAME-1.0.jar /app/ +CMD java -Xmx200m -jar /app/$SERVICE_NAME-1.0.jar EXPOSE 16115 \ No newline at end of file diff --git a/ts-admin-user-service/Dockerfile.dockerignore b/ts-admin-user-service/Dockerfile.dockerignore new file mode 100644 index 000000000..59de3eae9 --- /dev/null +++ b/ts-admin-user-service/Dockerfile.dockerignore @@ -0,0 +1,6 @@ +* +!/pom.xml +!/ts-common/pom.xml +!/ts-common/src +!/ts-admin-user-service/pom.xml +!/ts-admin-user-service/src diff --git a/ts-assurance-service/Dockerfile b/ts-assurance-service/Dockerfile index 6991cfd7e..1dfc70a37 100644 --- a/ts-assurance-service/Dockerfile +++ b/ts-assurance-service/Dockerfile @@ -1,8 +1,30 @@ -FROM java:8-jre +From maven:3.9.1-eclipse-temurin-8 as build + +WORKDIR /app + +COPY pom.xml pom.xml +COPY ts-common/pom.xml ts-common/pom.xml +# Remove all modules except ts-common +RUN sed -i "/\(ts-common\)<\/module>/!{/.*<\/module>/d}" pom.xml +RUN mvn dependency:go-offline -B + +ARG SERVICE_NAME=ts-assurance-service +# Add $SERVICE_NAME module +RUN sed -i "/ts-common<\/module>/a $SERVICE_NAME" pom.xml +COPY $SERVICE_NAME/pom.xml $SERVICE_NAME/pom.xml + +COPY ts-common/src ./ts-common/src +COPY $SERVICE_NAME/src ./$SERVICE_NAME/src + +RUN mvn package -DskipTests + +FROM eclipse-temurin:8-jre +ARG SERVICE_NAME=ts-assurance-service +ENV SERVICE_NAME=$SERVICE_NAME RUN /bin/cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai' >/etc/timezone -ADD ./target/ts-assurance-service-1.0.jar /app/ -CMD ["java", "-Xmx200m", "-jar", "/app/ts-assurance-service-1.0.jar"] +COPY --from=build /app/$SERVICE_NAME/target/$SERVICE_NAME-1.0.jar /app/ +CMD java -Xmx200m -jar /app/$SERVICE_NAME-1.0.jar EXPOSE 18888 \ No newline at end of file diff --git a/ts-assurance-service/Dockerfile.dockerignore b/ts-assurance-service/Dockerfile.dockerignore new file mode 100644 index 000000000..a6f6af5cf --- /dev/null +++ b/ts-assurance-service/Dockerfile.dockerignore @@ -0,0 +1,6 @@ +* +!/pom.xml +!/ts-common/pom.xml +!/ts-common/src +!/ts-assurance-service/pom.xml +!/ts-assurance-service/src diff --git a/ts-auth-service/Dockerfile b/ts-auth-service/Dockerfile index cbc06d73b..1ca42b81a 100644 --- a/ts-auth-service/Dockerfile +++ b/ts-auth-service/Dockerfile @@ -1,8 +1,30 @@ -FROM java:8-jre +From maven:3.9.1-eclipse-temurin-8 as build + +WORKDIR /app + +COPY pom.xml pom.xml +COPY ts-common/pom.xml ts-common/pom.xml +# Remove all modules except ts-common +RUN sed -i "/\(ts-common\)<\/module>/!{/.*<\/module>/d}" pom.xml +RUN mvn dependency:go-offline -B + +ARG SERVICE_NAME=ts-auth-service +# Add $SERVICE_NAME module +RUN sed -i "/ts-common<\/module>/a $SERVICE_NAME" pom.xml +COPY $SERVICE_NAME/pom.xml $SERVICE_NAME/pom.xml + +COPY ts-common/src ./ts-common/src +COPY $SERVICE_NAME/src ./$SERVICE_NAME/src + +RUN mvn package -DskipTests + +FROM eclipse-temurin:8-jre +ARG SERVICE_NAME=ts-auth-service +ENV SERVICE_NAME=$SERVICE_NAME RUN /bin/cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai' >/etc/timezone -ADD ./target/ts-auth-service-1.0.jar /app/ -CMD ["java", "-Xmx200m", "-jar", "/app/ts-auth-service-1.0.jar"] +COPY --from=build /app/$SERVICE_NAME/target/$SERVICE_NAME-1.0.jar /app/ +CMD java -Xmx200m -jar /app/$SERVICE_NAME-1.0.jar EXPOSE 12349 \ No newline at end of file diff --git a/ts-auth-service/Dockerfile.dockerignore b/ts-auth-service/Dockerfile.dockerignore new file mode 100644 index 000000000..136945d3a --- /dev/null +++ b/ts-auth-service/Dockerfile.dockerignore @@ -0,0 +1,6 @@ +* +!/pom.xml +!/ts-common/pom.xml +!/ts-common/src +!/ts-auth-service/pom.xml +!/ts-auth-service/src diff --git a/ts-avatar-service/Dockerfile b/ts-avatar-service/Dockerfile index 715a1c39c..862c24c36 100644 --- a/ts-avatar-service/Dockerfile +++ b/ts-avatar-service/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3 +FROM python:3.9.6 RUN /bin/cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai' >/etc/timezone @@ -9,7 +9,7 @@ RUN apt install -y libgl1-mesa-glx ENV PYTHONUNBUFFERED=TRUE RUN mkdir -p /app -ADD . /app/ +ADD ts-avatar-service /app/ WORKDIR /app RUN pip install -r requirements.txt diff --git a/ts-basic-service/Dockerfile b/ts-basic-service/Dockerfile index 44045e159..6375c8fee 100644 --- a/ts-basic-service/Dockerfile +++ b/ts-basic-service/Dockerfile @@ -1,8 +1,30 @@ -FROM java:8-jre +From maven:3.9.1-eclipse-temurin-8 as build + +WORKDIR /app + +COPY pom.xml pom.xml +COPY ts-common/pom.xml ts-common/pom.xml +# Remove all modules except ts-common +RUN sed -i "/\(ts-common\)<\/module>/!{/.*<\/module>/d}" pom.xml +RUN mvn dependency:go-offline -B + +ARG SERVICE_NAME=ts-basic-service +# Add $SERVICE_NAME module +RUN sed -i "/ts-common<\/module>/a $SERVICE_NAME" pom.xml +COPY $SERVICE_NAME/pom.xml $SERVICE_NAME/pom.xml + +COPY ts-common/src ./ts-common/src +COPY $SERVICE_NAME/src ./$SERVICE_NAME/src + +RUN mvn package -DskipTests + +FROM eclipse-temurin:8-jre +ARG SERVICE_NAME=ts-basic-service +ENV SERVICE_NAME=$SERVICE_NAME RUN /bin/cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai' >/etc/timezone -ADD ./target/ts-basic-service-1.0.jar /app/ -CMD ["java", "-Xmx200m", "-jar", "/app/ts-basic-service-1.0.jar"] +COPY --from=build /app/$SERVICE_NAME/target/$SERVICE_NAME-1.0.jar /app/ +CMD java -Xmx200m -jar /app/$SERVICE_NAME-1.0.jar EXPOSE 15680 \ No newline at end of file diff --git a/ts-basic-service/Dockerfile.dockerignore b/ts-basic-service/Dockerfile.dockerignore new file mode 100644 index 000000000..22301f105 --- /dev/null +++ b/ts-basic-service/Dockerfile.dockerignore @@ -0,0 +1,6 @@ +* +!/pom.xml +!/ts-common/pom.xml +!/ts-common/src +!/ts-basic-service/pom.xml +!/ts-basic-service/src diff --git a/ts-cancel-service/Dockerfile b/ts-cancel-service/Dockerfile index e553e76c0..1dac5d90c 100644 --- a/ts-cancel-service/Dockerfile +++ b/ts-cancel-service/Dockerfile @@ -1,8 +1,30 @@ -FROM java:8-jre +From maven:3.9.1-eclipse-temurin-8 as build + +WORKDIR /app + +COPY pom.xml pom.xml +COPY ts-common/pom.xml ts-common/pom.xml +# Remove all modules except ts-common +RUN sed -i "/\(ts-common\)<\/module>/!{/.*<\/module>/d}" pom.xml +RUN mvn dependency:go-offline -B + +ARG SERVICE_NAME=ts-cancel-service +# Add $SERVICE_NAME module +RUN sed -i "/ts-common<\/module>/a $SERVICE_NAME" pom.xml +COPY $SERVICE_NAME/pom.xml $SERVICE_NAME/pom.xml + +COPY ts-common/src ./ts-common/src +COPY $SERVICE_NAME/src ./$SERVICE_NAME/src + +RUN mvn package -DskipTests + +FROM eclipse-temurin:8-jre +ARG SERVICE_NAME=ts-cancel-service +ENV SERVICE_NAME=$SERVICE_NAME RUN /bin/cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai' >/etc/timezone -ADD ./target/ts-cancel-service-1.0.jar /app/ -CMD ["java", "-Xmx200m", "-jar", "/app/ts-cancel-service-1.0.jar"] +COPY --from=build /app/$SERVICE_NAME/target/$SERVICE_NAME-1.0.jar /app/ +CMD java -Xmx200m -jar /app/$SERVICE_NAME-1.0.jar EXPOSE 18885 \ No newline at end of file diff --git a/ts-cancel-service/Dockerfile.dockerignore b/ts-cancel-service/Dockerfile.dockerignore new file mode 100644 index 000000000..08eb06f1f --- /dev/null +++ b/ts-cancel-service/Dockerfile.dockerignore @@ -0,0 +1,6 @@ +* +!/pom.xml +!/ts-common/pom.xml +!/ts-common/src +!/ts-cancel-service/pom.xml +!/ts-cancel-service/src diff --git a/ts-config-service/Dockerfile b/ts-config-service/Dockerfile index dd9aaba1c..c03020bd5 100644 --- a/ts-config-service/Dockerfile +++ b/ts-config-service/Dockerfile @@ -1,8 +1,30 @@ -FROM java:8-jre +From maven:3.9.1-eclipse-temurin-8 as build + +WORKDIR /app + +COPY pom.xml pom.xml +COPY ts-common/pom.xml ts-common/pom.xml +# Remove all modules except ts-common +RUN sed -i "/\(ts-common\)<\/module>/!{/.*<\/module>/d}" pom.xml +RUN mvn dependency:go-offline -B + +ARG SERVICE_NAME=ts-config-service +# Add $SERVICE_NAME module +RUN sed -i "/ts-common<\/module>/a $SERVICE_NAME" pom.xml +COPY $SERVICE_NAME/pom.xml $SERVICE_NAME/pom.xml + +COPY ts-common/src ./ts-common/src +COPY $SERVICE_NAME/src ./$SERVICE_NAME/src + +RUN mvn package -DskipTests + +FROM eclipse-temurin:8-jre +ARG SERVICE_NAME=ts-config-service +ENV SERVICE_NAME=$SERVICE_NAME RUN /bin/cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai' >/etc/timezone -ADD ./target/ts-config-service-1.0.jar /app/ -CMD ["java", "-Xmx200m", "-jar", "/app/ts-config-service-1.0.jar"] +COPY --from=build /app/$SERVICE_NAME/target/$SERVICE_NAME-1.0.jar /app/ +CMD java -Xmx200m -jar /app/$SERVICE_NAME-1.0.jar EXPOSE 15679 \ No newline at end of file diff --git a/ts-config-service/Dockerfile.dockerignore b/ts-config-service/Dockerfile.dockerignore new file mode 100644 index 000000000..00fff6de5 --- /dev/null +++ b/ts-config-service/Dockerfile.dockerignore @@ -0,0 +1,6 @@ +* +!/pom.xml +!/ts-common/pom.xml +!/ts-common/src +!/ts-config-service/pom.xml +!/ts-config-service/src diff --git a/ts-consign-price-service/Dockerfile b/ts-consign-price-service/Dockerfile index 1d7c87766..57e71c927 100644 --- a/ts-consign-price-service/Dockerfile +++ b/ts-consign-price-service/Dockerfile @@ -1,8 +1,30 @@ -FROM java:8-jre +From maven:3.9.1-eclipse-temurin-8 as build + +WORKDIR /app + +COPY pom.xml pom.xml +COPY ts-common/pom.xml ts-common/pom.xml +# Remove all modules except ts-common +RUN sed -i "/\(ts-common\)<\/module>/!{/.*<\/module>/d}" pom.xml +RUN mvn dependency:go-offline -B + +ARG SERVICE_NAME=ts-consign-price-service +# Add $SERVICE_NAME module +RUN sed -i "/ts-common<\/module>/a $SERVICE_NAME" pom.xml +COPY $SERVICE_NAME/pom.xml $SERVICE_NAME/pom.xml + +COPY ts-common/src ./ts-common/src +COPY $SERVICE_NAME/src ./$SERVICE_NAME/src + +RUN mvn package -DskipTests + +FROM eclipse-temurin:8-jre +ARG SERVICE_NAME=ts-consign-price-service +ENV SERVICE_NAME=$SERVICE_NAME RUN /bin/cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai' >/etc/timezone -ADD ./target/ts-consign-price-service-1.0.jar /app/ -CMD ["java", "-Xmx200m", "-jar", "/app/ts-consign-price-service-1.0.jar"] +COPY --from=build /app/$SERVICE_NAME/target/$SERVICE_NAME-1.0.jar /app/ +CMD java -Xmx200m -jar /app/$SERVICE_NAME-1.0.jar EXPOSE 16110 \ No newline at end of file diff --git a/ts-consign-price-service/Dockerfile.dockerignore b/ts-consign-price-service/Dockerfile.dockerignore new file mode 100644 index 000000000..cd98ad02c --- /dev/null +++ b/ts-consign-price-service/Dockerfile.dockerignore @@ -0,0 +1,6 @@ +* +!/pom.xml +!/ts-common/pom.xml +!/ts-common/src +!/ts-consign-price-service/pom.xml +!/ts-consign-price-service/src diff --git a/ts-consign-service/Dockerfile b/ts-consign-service/Dockerfile index d592b2afb..1a1e033ba 100644 --- a/ts-consign-service/Dockerfile +++ b/ts-consign-service/Dockerfile @@ -1,8 +1,30 @@ -FROM java:8-jre +From maven:3.9.1-eclipse-temurin-8 as build + +WORKDIR /app + +COPY pom.xml pom.xml +COPY ts-common/pom.xml ts-common/pom.xml +# Remove all modules except ts-common +RUN sed -i "/\(ts-common\)<\/module>/!{/.*<\/module>/d}" pom.xml +RUN mvn dependency:go-offline -B + +ARG SERVICE_NAME=ts-consign-service +# Add $SERVICE_NAME module +RUN sed -i "/ts-common<\/module>/a $SERVICE_NAME" pom.xml +COPY $SERVICE_NAME/pom.xml $SERVICE_NAME/pom.xml + +COPY ts-common/src ./ts-common/src +COPY $SERVICE_NAME/src ./$SERVICE_NAME/src + +RUN mvn package -DskipTests + +FROM eclipse-temurin:8-jre +ARG SERVICE_NAME=ts-consign-service +ENV SERVICE_NAME=$SERVICE_NAME RUN /bin/cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai' >/etc/timezone -ADD ./target/ts-consign-service-1.0.jar /app/ -CMD ["java", "-Xmx200m", "-jar", "/app/ts-consign-service-1.0.jar"] +COPY --from=build /app/$SERVICE_NAME/target/$SERVICE_NAME-1.0.jar /app/ +CMD java -Xmx200m -jar /app/$SERVICE_NAME-1.0.jar EXPOSE 16111 \ No newline at end of file diff --git a/ts-consign-service/Dockerfile.dockerignore b/ts-consign-service/Dockerfile.dockerignore new file mode 100644 index 000000000..61006d7a8 --- /dev/null +++ b/ts-consign-service/Dockerfile.dockerignore @@ -0,0 +1,6 @@ +* +!/pom.xml +!/ts-common/pom.xml +!/ts-common/src +!/ts-consign-service/pom.xml +!/ts-consign-service/src diff --git a/ts-contacts-service/Dockerfile b/ts-contacts-service/Dockerfile index 35be04a09..2f2bb6271 100644 --- a/ts-contacts-service/Dockerfile +++ b/ts-contacts-service/Dockerfile @@ -1,8 +1,30 @@ -FROM java:8-jre +From maven:3.9.1-eclipse-temurin-8 as build + +WORKDIR /app + +COPY pom.xml pom.xml +COPY ts-common/pom.xml ts-common/pom.xml +# Remove all modules except ts-common +RUN sed -i "/\(ts-common\)<\/module>/!{/.*<\/module>/d}" pom.xml +RUN mvn dependency:go-offline -B + +ARG SERVICE_NAME=ts-contacts-service +# Add $SERVICE_NAME module +RUN sed -i "/ts-common<\/module>/a $SERVICE_NAME" pom.xml +COPY $SERVICE_NAME/pom.xml $SERVICE_NAME/pom.xml + +COPY ts-common/src ./ts-common/src +COPY $SERVICE_NAME/src ./$SERVICE_NAME/src + +RUN mvn package -DskipTests + +FROM eclipse-temurin:8-jre +ARG SERVICE_NAME=ts-contacts-service +ENV SERVICE_NAME=$SERVICE_NAME RUN /bin/cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai' >/etc/timezone -ADD ./target/ts-contacts-service-1.0.jar /app/ -CMD ["java", "-Xmx200m", "-jar", "/app/ts-contacts-service-1.0.jar"] +COPY --from=build /app/$SERVICE_NAME/target/$SERVICE_NAME-1.0.jar /app/ +CMD java -Xmx200m -jar /app/$SERVICE_NAME-1.0.jar EXPOSE 12347 \ No newline at end of file diff --git a/ts-contacts-service/Dockerfile.dockerignore b/ts-contacts-service/Dockerfile.dockerignore new file mode 100644 index 000000000..371fdae4f --- /dev/null +++ b/ts-contacts-service/Dockerfile.dockerignore @@ -0,0 +1,6 @@ +* +!/pom.xml +!/ts-common/pom.xml +!/ts-common/src +!/ts-contacts-service/pom.xml +!/ts-contacts-service/src diff --git a/ts-delivery-service/Dockerfile b/ts-delivery-service/Dockerfile index 619afbee4..337ece9a8 100644 --- a/ts-delivery-service/Dockerfile +++ b/ts-delivery-service/Dockerfile @@ -1,8 +1,30 @@ -FROM java:8-jre +From maven:3.9.1-eclipse-temurin-8 as build + +WORKDIR /app + +COPY pom.xml pom.xml +COPY ts-common/pom.xml ts-common/pom.xml +# Remove all modules except ts-common +RUN sed -i "/\(ts-common\)<\/module>/!{/.*<\/module>/d}" pom.xml +RUN mvn dependency:go-offline -B + +ARG SERVICE_NAME=ts-delivery-service +# Add $SERVICE_NAME module +RUN sed -i "/ts-common<\/module>/a $SERVICE_NAME" pom.xml +COPY $SERVICE_NAME/pom.xml $SERVICE_NAME/pom.xml + +COPY ts-common/src ./ts-common/src +COPY $SERVICE_NAME/src ./$SERVICE_NAME/src + +RUN mvn package -DskipTests + +FROM eclipse-temurin:8-jre +ARG SERVICE_NAME=ts-delivery-service +ENV SERVICE_NAME=$SERVICE_NAME RUN /bin/cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai' >/etc/timezone -ADD ./target/ts-delivery-service-1.0.jar /app/ -CMD ["java", "-Xmx200m", "-jar", "/app/ts-delivery-service-1.0.jar"] +COPY --from=build /app/$SERVICE_NAME/target/$SERVICE_NAME-1.0.jar /app/ +CMD java -Xmx200m -jar /app/$SERVICE_NAME-1.0.jar EXPOSE 18856 diff --git a/ts-delivery-service/Dockerfile.dockerignore b/ts-delivery-service/Dockerfile.dockerignore new file mode 100644 index 000000000..97edd9587 --- /dev/null +++ b/ts-delivery-service/Dockerfile.dockerignore @@ -0,0 +1,6 @@ +* +!/pom.xml +!/ts-common/pom.xml +!/ts-common/src +!/ts-delivery-service/pom.xml +!/ts-delivery-service/src diff --git a/ts-execute-service/Dockerfile b/ts-execute-service/Dockerfile index b97ab4739..83b9e5920 100644 --- a/ts-execute-service/Dockerfile +++ b/ts-execute-service/Dockerfile @@ -1,8 +1,30 @@ -FROM java:8-jre +From maven:3.9.1-eclipse-temurin-8 as build + +WORKDIR /app + +COPY pom.xml pom.xml +COPY ts-common/pom.xml ts-common/pom.xml +# Remove all modules except ts-common +RUN sed -i "/\(ts-common\)<\/module>/!{/.*<\/module>/d}" pom.xml +RUN mvn dependency:go-offline -B + +ARG SERVICE_NAME=ts-execute-service +# Add $SERVICE_NAME module +RUN sed -i "/ts-common<\/module>/a $SERVICE_NAME" pom.xml +COPY $SERVICE_NAME/pom.xml $SERVICE_NAME/pom.xml + +COPY ts-common/src ./ts-common/src +COPY $SERVICE_NAME/src ./$SERVICE_NAME/src + +RUN mvn package -DskipTests + +FROM eclipse-temurin:8-jre +ARG SERVICE_NAME=ts-execute-service +ENV SERVICE_NAME=$SERVICE_NAME RUN /bin/cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai' >/etc/timezone -ADD ./target/ts-execute-service-1.0.jar /app/ -CMD ["java", "-Xmx200m", "-jar", "/app/ts-execute-service-1.0.jar"] +COPY --from=build /app/$SERVICE_NAME/target/$SERVICE_NAME-1.0.jar /app/ +CMD java -Xmx200m -jar /app/$SERVICE_NAME-1.0.jar EXPOSE 12386 \ No newline at end of file diff --git a/ts-execute-service/Dockerfile.dockerignore b/ts-execute-service/Dockerfile.dockerignore new file mode 100644 index 000000000..487355c14 --- /dev/null +++ b/ts-execute-service/Dockerfile.dockerignore @@ -0,0 +1,6 @@ +* +!/pom.xml +!/ts-common/pom.xml +!/ts-common/src +!/ts-execute-service/pom.xml +!/ts-execute-service/src diff --git a/ts-food-delivery-service/Dockerfile b/ts-food-delivery-service/Dockerfile index fcca1fb4a..91043533f 100644 --- a/ts-food-delivery-service/Dockerfile +++ b/ts-food-delivery-service/Dockerfile @@ -1,8 +1,30 @@ -FROM java:8-jre +From maven:3.9.1-eclipse-temurin-8 as build + +WORKDIR /app + +COPY pom.xml pom.xml +COPY ts-common/pom.xml ts-common/pom.xml +# Remove all modules except ts-common +RUN sed -i "/\(ts-common\)<\/module>/!{/.*<\/module>/d}" pom.xml +RUN mvn dependency:go-offline -B + +ARG SERVICE_NAME=ts-food-delivery-service +# Add $SERVICE_NAME module +RUN sed -i "/ts-common<\/module>/a $SERVICE_NAME" pom.xml +COPY $SERVICE_NAME/pom.xml $SERVICE_NAME/pom.xml + +COPY ts-common/src ./ts-common/src +COPY $SERVICE_NAME/src ./$SERVICE_NAME/src + +RUN mvn package -DskipTests + +FROM eclipse-temurin:8-jre +ARG SERVICE_NAME=ts-food-delivery-service +ENV SERVICE_NAME=$SERVICE_NAME RUN /bin/cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai' >/etc/timezone -ADD ./target/ts-food-delivery-service-1.0.jar /app/ -CMD ["java", "-Xmx200m", "-jar", "/app/ts-food-delivery-service-1.0.jar"] +COPY --from=build /app/$SERVICE_NAME/target/$SERVICE_NAME-1.0.jar /app/ +CMD java -Xmx200m -jar /app/$SERVICE_NAME-1.0.jar EXPOSE 18957 diff --git a/ts-food-delivery-service/Dockerfile.dockerignore b/ts-food-delivery-service/Dockerfile.dockerignore new file mode 100644 index 000000000..0adb24651 --- /dev/null +++ b/ts-food-delivery-service/Dockerfile.dockerignore @@ -0,0 +1,6 @@ +* +!/pom.xml +!/ts-common/pom.xml +!/ts-common/src +!/ts-food-delivery-service/pom.xml +!/ts-food-delivery-service/src diff --git a/ts-food-service/Dockerfile b/ts-food-service/Dockerfile index bf68dd49c..cd7b50b54 100644 --- a/ts-food-service/Dockerfile +++ b/ts-food-service/Dockerfile @@ -1,8 +1,30 @@ -FROM java:8-jre +From maven:3.9.1-eclipse-temurin-8 as build + +WORKDIR /app + +COPY pom.xml pom.xml +COPY ts-common/pom.xml ts-common/pom.xml +# Remove all modules except ts-common +RUN sed -i "/\(ts-common\)<\/module>/!{/.*<\/module>/d}" pom.xml +RUN mvn dependency:go-offline -B + +ARG SERVICE_NAME=ts-food-service +# Add $SERVICE_NAME module +RUN sed -i "/ts-common<\/module>/a $SERVICE_NAME" pom.xml +COPY $SERVICE_NAME/pom.xml $SERVICE_NAME/pom.xml + +COPY ts-common/src ./ts-common/src +COPY $SERVICE_NAME/src ./$SERVICE_NAME/src + +RUN mvn package -DskipTests + +FROM eclipse-temurin:8-jre +ARG SERVICE_NAME=ts-food-service +ENV SERVICE_NAME=$SERVICE_NAME RUN /bin/cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai' >/etc/timezone -ADD ./target/ts-food-service-1.0.jar /app/ -CMD ["java", "-Xmx200m", "-jar", "/app/ts-food-service-1.0.jar"] +COPY --from=build /app/$SERVICE_NAME/target/$SERVICE_NAME-1.0.jar /app/ +CMD java -Xmx200m -jar /app/$SERVICE_NAME-1.0.jar EXPOSE 18856 \ No newline at end of file diff --git a/ts-food-service/Dockerfile.dockerignore b/ts-food-service/Dockerfile.dockerignore new file mode 100644 index 000000000..977b0d27f --- /dev/null +++ b/ts-food-service/Dockerfile.dockerignore @@ -0,0 +1,6 @@ +* +!/pom.xml +!/ts-common/pom.xml +!/ts-common/src +!/ts-food-service/pom.xml +!/ts-food-service/src diff --git a/ts-gateway-service/Dockerfile b/ts-gateway-service/Dockerfile index 3468588f2..cdd21745a 100644 --- a/ts-gateway-service/Dockerfile +++ b/ts-gateway-service/Dockerfile @@ -1,8 +1,30 @@ -FROM java:8-jre +From maven:3.9.1-eclipse-temurin-8 as build + +WORKDIR /app + +COPY pom.xml pom.xml +COPY ts-common/pom.xml ts-common/pom.xml +# Remove all modules except ts-common +RUN sed -i "/\(ts-common\)<\/module>/!{/.*<\/module>/d}" pom.xml +RUN mvn dependency:go-offline -B + +ARG SERVICE_NAME=ts-gateway-service +# Add $SERVICE_NAME module +RUN sed -i "/ts-common<\/module>/a $SERVICE_NAME" pom.xml +COPY $SERVICE_NAME/pom.xml $SERVICE_NAME/pom.xml + +COPY ts-common/src ./ts-common/src +COPY $SERVICE_NAME/src ./$SERVICE_NAME/src + +RUN mvn package -DskipTests + +FROM eclipse-temurin:8-jre +ARG SERVICE_NAME=ts-gateway-service +ENV SERVICE_NAME=$SERVICE_NAME RUN /bin/cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai' >/etc/timezone -ADD ./target/ts-gateway-service-1.0.jar /app/ -CMD ["java", "-Xmx1024m", "-jar", "/app/ts-gateway-service-1.0.jar"] +COPY --from=build /app/$SERVICE_NAME/target/$SERVICE_NAME-1.0.jar /app/ +CMD java -Xmx1024m -jar /app/$SERVICE_NAME-1.0.jar EXPOSE 18888 diff --git a/ts-gateway-service/Dockerfile.dockerignore b/ts-gateway-service/Dockerfile.dockerignore new file mode 100644 index 000000000..db7c12379 --- /dev/null +++ b/ts-gateway-service/Dockerfile.dockerignore @@ -0,0 +1,6 @@ +* +!/pom.xml +!/ts-common/pom.xml +!/ts-common/src +!/ts-gateway-service/pom.xml +!/ts-gateway-service/src diff --git a/ts-inside-payment-service/Dockerfile b/ts-inside-payment-service/Dockerfile index 2b4cc4523..2f1cd51d3 100644 --- a/ts-inside-payment-service/Dockerfile +++ b/ts-inside-payment-service/Dockerfile @@ -1,8 +1,30 @@ -FROM java:8-jre +From maven:3.9.1-eclipse-temurin-8 as build + +WORKDIR /app + +COPY pom.xml pom.xml +COPY ts-common/pom.xml ts-common/pom.xml +# Remove all modules except ts-common +RUN sed -i "/\(ts-common\)<\/module>/!{/.*<\/module>/d}" pom.xml +RUN mvn dependency:go-offline -B + +ARG SERVICE_NAME=ts-inside-payment-service +# Add $SERVICE_NAME module +RUN sed -i "/ts-common<\/module>/a $SERVICE_NAME" pom.xml +COPY $SERVICE_NAME/pom.xml $SERVICE_NAME/pom.xml + +COPY ts-common/src ./ts-common/src +COPY $SERVICE_NAME/src ./$SERVICE_NAME/src + +RUN mvn package -DskipTests + +FROM eclipse-temurin:8-jre +ARG SERVICE_NAME=ts-inside-payment-service +ENV SERVICE_NAME=$SERVICE_NAME RUN /bin/cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai' >/etc/timezone -ADD ./target/ts-inside-payment-service-1.0.jar /app/ -CMD ["java", "-Xmx200m", "-jar", "/app/ts-inside-payment-service-1.0.jar"] +COPY --from=build /app/$SERVICE_NAME/target/$SERVICE_NAME-1.0.jar /app/ +CMD java -Xmx200m -jar /app/$SERVICE_NAME-1.0.jar EXPOSE 18673 \ No newline at end of file diff --git a/ts-inside-payment-service/Dockerfile.dockerignore b/ts-inside-payment-service/Dockerfile.dockerignore new file mode 100644 index 000000000..ba3dbc90a --- /dev/null +++ b/ts-inside-payment-service/Dockerfile.dockerignore @@ -0,0 +1,6 @@ +* +!/pom.xml +!/ts-common/pom.xml +!/ts-common/src +!/ts-inside-payment-service/pom.xml +!/ts-inside-payment-service/src diff --git a/ts-news-service/Dockerfile b/ts-news-service/Dockerfile index e8a4a5805..2dfa6be21 100644 --- a/ts-news-service/Dockerfile +++ b/ts-news-service/Dockerfile @@ -4,7 +4,7 @@ FROM mrrm/web.go RUN mkdir -p /app WORKDIR /app -ADD ./src/main/main.go /app/ +ADD ./ts-news-service/src/main/main.go /app/ RUN go build CMD [ "./app" ] diff --git a/ts-notification-service/Dockerfile b/ts-notification-service/Dockerfile index b1d835884..404ef67bb 100644 --- a/ts-notification-service/Dockerfile +++ b/ts-notification-service/Dockerfile @@ -1,8 +1,30 @@ -FROM java:8-jre +From maven:3.9.1-eclipse-temurin-8 as build + +WORKDIR /app + +COPY pom.xml pom.xml +COPY ts-common/pom.xml ts-common/pom.xml +# Remove all modules except ts-common +RUN sed -i "/\(ts-common\)<\/module>/!{/.*<\/module>/d}" pom.xml +RUN mvn dependency:go-offline -B + +ARG SERVICE_NAME=ts-notification-service +# Add $SERVICE_NAME module +RUN sed -i "/ts-common<\/module>/a $SERVICE_NAME" pom.xml +COPY $SERVICE_NAME/pom.xml $SERVICE_NAME/pom.xml + +COPY ts-common/src ./ts-common/src +COPY $SERVICE_NAME/src ./$SERVICE_NAME/src + +RUN mvn package -DskipTests + +FROM eclipse-temurin:8-jre +ARG SERVICE_NAME=ts-notification-service +ENV SERVICE_NAME=$SERVICE_NAME RUN /bin/cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai' >/etc/timezone -ADD ./target/ts-notification-service-1.0.jar /app/ -CMD ["java", "-Xmx200m", "-jar", "/app/ts-notification-service-1.0.jar"] +COPY --from=build /app/$SERVICE_NAME/target/$SERVICE_NAME-1.0.jar /app/ +CMD java -Xmx200m -jar /app/$SERVICE_NAME-1.0.jar EXPOSE 17853 \ No newline at end of file diff --git a/ts-notification-service/Dockerfile.dockerignore b/ts-notification-service/Dockerfile.dockerignore new file mode 100644 index 000000000..85820f0a5 --- /dev/null +++ b/ts-notification-service/Dockerfile.dockerignore @@ -0,0 +1,6 @@ +* +!/pom.xml +!/ts-common/pom.xml +!/ts-common/src +!/ts-notification-service/pom.xml +!/ts-notification-service/src diff --git a/ts-order-other-service/Dockerfile b/ts-order-other-service/Dockerfile index e53ed542a..d7b157e4c 100644 --- a/ts-order-other-service/Dockerfile +++ b/ts-order-other-service/Dockerfile @@ -1,8 +1,30 @@ -FROM java:8-jre +From maven:3.9.1-eclipse-temurin-8 as build + +WORKDIR /app + +COPY pom.xml pom.xml +COPY ts-common/pom.xml ts-common/pom.xml +# Remove all modules except ts-common +RUN sed -i "/\(ts-common\)<\/module>/!{/.*<\/module>/d}" pom.xml +RUN mvn dependency:go-offline -B + +ARG SERVICE_NAME=ts-order-other-service +# Add $SERVICE_NAME module +RUN sed -i "/ts-common<\/module>/a $SERVICE_NAME" pom.xml +COPY $SERVICE_NAME/pom.xml $SERVICE_NAME/pom.xml + +COPY ts-common/src ./ts-common/src +COPY $SERVICE_NAME/src ./$SERVICE_NAME/src + +RUN mvn package -DskipTests + +FROM eclipse-temurin:8-jre +ARG SERVICE_NAME=ts-order-other-service +ENV SERVICE_NAME=$SERVICE_NAME RUN /bin/cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai' >/etc/timezone -ADD ./target/ts-order-other-service-1.0.jar /app/ -CMD ["java", "-Xmx200m", "-jar", "/app/ts-order-other-service-1.0.jar"] +COPY --from=build /app/$SERVICE_NAME/target/$SERVICE_NAME-1.0.jar /app/ +CMD java -Xmx200m -jar /app/$SERVICE_NAME-1.0.jar #CMD java $JAVA_OPTIONS -jar /app/ts-order-other-service-1.0.jar EXPOSE 12032 \ No newline at end of file diff --git a/ts-order-other-service/Dockerfile.dockerignore b/ts-order-other-service/Dockerfile.dockerignore new file mode 100644 index 000000000..bc701dc82 --- /dev/null +++ b/ts-order-other-service/Dockerfile.dockerignore @@ -0,0 +1,6 @@ +* +!/pom.xml +!/ts-common/pom.xml +!/ts-common/src +!/ts-order-other-service/pom.xml +!/ts-order-other-service/src diff --git a/ts-order-service/Dockerfile b/ts-order-service/Dockerfile index da8c10924..30288db28 100644 --- a/ts-order-service/Dockerfile +++ b/ts-order-service/Dockerfile @@ -1,9 +1,31 @@ -FROM java:8-jre +From maven:3.9.1-eclipse-temurin-8 as build + +WORKDIR /app + +COPY pom.xml pom.xml +COPY ts-common/pom.xml ts-common/pom.xml +# Remove all modules except ts-common +RUN sed -i "/\(ts-common\)<\/module>/!{/.*<\/module>/d}" pom.xml +RUN mvn dependency:go-offline -B + +ARG SERVICE_NAME=ts-order-service +# Add $SERVICE_NAME module +RUN sed -i "/ts-common<\/module>/a $SERVICE_NAME" pom.xml +COPY $SERVICE_NAME/pom.xml $SERVICE_NAME/pom.xml + +COPY ts-common/src ./ts-common/src +COPY $SERVICE_NAME/src ./$SERVICE_NAME/src + +RUN mvn package -DskipTests + +FROM eclipse-temurin:8-jre +ARG SERVICE_NAME=ts-order-service +ENV SERVICE_NAME=$SERVICE_NAME RUN /bin/cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai' >/etc/timezone -ADD ./target/ts-order-service-1.0.jar /app/ -CMD ["java", "-Xmx200m", "-jar", "/app/ts-order-service-1.0.jar"] +COPY --from=build /app/$SERVICE_NAME/target/$SERVICE_NAME-1.0.jar /app/ +CMD java -Xmx200m -jar /app/$SERVICE_NAME-1.0.jar #CMD java $JAVA_OPTIONS -jar /app/ts-order-service-1.0.jar EXPOSE 12031 \ No newline at end of file diff --git a/ts-order-service/Dockerfile.dockerignore b/ts-order-service/Dockerfile.dockerignore new file mode 100644 index 000000000..bcb4b06e6 --- /dev/null +++ b/ts-order-service/Dockerfile.dockerignore @@ -0,0 +1,6 @@ +* +!/pom.xml +!/ts-common/pom.xml +!/ts-common/src +!/ts-order-service/pom.xml +!/ts-order-service/src diff --git a/ts-payment-service/Dockerfile b/ts-payment-service/Dockerfile index fa20f2bf6..aa66f5e37 100644 --- a/ts-payment-service/Dockerfile +++ b/ts-payment-service/Dockerfile @@ -1,8 +1,30 @@ -FROM java:8-jre +From maven:3.9.1-eclipse-temurin-8 as build + +WORKDIR /app + +COPY pom.xml pom.xml +COPY ts-common/pom.xml ts-common/pom.xml +# Remove all modules except ts-common +RUN sed -i "/\(ts-common\)<\/module>/!{/.*<\/module>/d}" pom.xml +RUN mvn dependency:go-offline -B + +ARG SERVICE_NAME=ts-payment-service +# Add $SERVICE_NAME module +RUN sed -i "/ts-common<\/module>/a $SERVICE_NAME" pom.xml +COPY $SERVICE_NAME/pom.xml $SERVICE_NAME/pom.xml + +COPY ts-common/src ./ts-common/src +COPY $SERVICE_NAME/src ./$SERVICE_NAME/src + +RUN mvn package -DskipTests + +FROM eclipse-temurin:8-jre +ARG SERVICE_NAME=ts-payment-service +ENV SERVICE_NAME=$SERVICE_NAME RUN /bin/cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai' >/etc/timezone -ADD ./target/ts-payment-service-1.0.jar /app/ -CMD ["java", "-Xmx200m", "-jar", "/app/ts-payment-service-1.0.jar"] +COPY --from=build /app/$SERVICE_NAME/target/$SERVICE_NAME-1.0.jar /app/ +CMD java -Xmx200m -jar /app/$SERVICE_NAME-1.0.jar EXPOSE 19001 \ No newline at end of file diff --git a/ts-payment-service/Dockerfile.dockerignore b/ts-payment-service/Dockerfile.dockerignore new file mode 100644 index 000000000..c578e7ac6 --- /dev/null +++ b/ts-payment-service/Dockerfile.dockerignore @@ -0,0 +1,6 @@ +* +!/pom.xml +!/ts-common/pom.xml +!/ts-common/src +!/ts-payment-service/pom.xml +!/ts-payment-service/src diff --git a/ts-preserve-other-service/Dockerfile b/ts-preserve-other-service/Dockerfile index 6f1fac7e3..ca9822a5d 100644 --- a/ts-preserve-other-service/Dockerfile +++ b/ts-preserve-other-service/Dockerfile @@ -1,8 +1,30 @@ -FROM java:8-jre +From maven:3.9.1-eclipse-temurin-8 as build + +WORKDIR /app + +COPY pom.xml pom.xml +COPY ts-common/pom.xml ts-common/pom.xml +# Remove all modules except ts-common +RUN sed -i "/\(ts-common\)<\/module>/!{/.*<\/module>/d}" pom.xml +RUN mvn dependency:go-offline -B + +ARG SERVICE_NAME=ts-preserve-other-service +# Add $SERVICE_NAME module +RUN sed -i "/ts-common<\/module>/a $SERVICE_NAME" pom.xml +COPY $SERVICE_NAME/pom.xml $SERVICE_NAME/pom.xml + +COPY ts-common/src ./ts-common/src +COPY $SERVICE_NAME/src ./$SERVICE_NAME/src + +RUN mvn package -DskipTests + +FROM eclipse-temurin:8-jre +ARG SERVICE_NAME=ts-preserve-other-service +ENV SERVICE_NAME=$SERVICE_NAME RUN /bin/cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai' >/etc/timezone -ADD ./target/ts-preserve-other-service-1.0.jar /app/ -CMD ["java", "-Xmx200m", "-jar", "/app/ts-preserve-other-service-1.0.jar"] +COPY --from=build /app/$SERVICE_NAME/target/$SERVICE_NAME-1.0.jar /app/ +CMD java -Xmx200m -jar /app/$SERVICE_NAME-1.0.jar EXPOSE 14569 \ No newline at end of file diff --git a/ts-preserve-other-service/Dockerfile.dockerignore b/ts-preserve-other-service/Dockerfile.dockerignore new file mode 100644 index 000000000..d9679a3e2 --- /dev/null +++ b/ts-preserve-other-service/Dockerfile.dockerignore @@ -0,0 +1,6 @@ +* +!/pom.xml +!/ts-common/pom.xml +!/ts-common/src +!/ts-preserve-other-service/pom.xml +!/ts-preserve-other-service/src diff --git a/ts-preserve-service/Dockerfile b/ts-preserve-service/Dockerfile index cf9785e87..89f72f67c 100644 --- a/ts-preserve-service/Dockerfile +++ b/ts-preserve-service/Dockerfile @@ -1,8 +1,30 @@ -FROM java:8-jre +From maven:3.9.1-eclipse-temurin-8 as build + +WORKDIR /app + +COPY pom.xml pom.xml +COPY ts-common/pom.xml ts-common/pom.xml +# Remove all modules except ts-common +RUN sed -i "/\(ts-common\)<\/module>/!{/.*<\/module>/d}" pom.xml +RUN mvn dependency:go-offline -B + +ARG SERVICE_NAME=ts-preserve-service +# Add $SERVICE_NAME module +RUN sed -i "/ts-common<\/module>/a $SERVICE_NAME" pom.xml +COPY $SERVICE_NAME/pom.xml $SERVICE_NAME/pom.xml + +COPY ts-common/src ./ts-common/src +COPY $SERVICE_NAME/src ./$SERVICE_NAME/src + +RUN mvn package -DskipTests + +FROM eclipse-temurin:8-jre +ARG SERVICE_NAME=ts-preserve-service +ENV SERVICE_NAME=$SERVICE_NAME RUN /bin/cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai' >/etc/timezone -ADD ./target/ts-preserve-service-1.0.jar /app/ -CMD ["java", "-Xmx200m", "-jar", "/app/ts-preserve-service-1.0.jar"] +COPY --from=build /app/$SERVICE_NAME/target/$SERVICE_NAME-1.0.jar /app/ +CMD java -Xmx200m -jar /app/$SERVICE_NAME-1.0.jar EXPOSE 14568 \ No newline at end of file diff --git a/ts-preserve-service/Dockerfile.dockerignore b/ts-preserve-service/Dockerfile.dockerignore new file mode 100644 index 000000000..d98e7fd6d --- /dev/null +++ b/ts-preserve-service/Dockerfile.dockerignore @@ -0,0 +1,6 @@ +* +!/pom.xml +!/ts-common/pom.xml +!/ts-common/src +!/ts-preserve-service/pom.xml +!/ts-preserve-service/src diff --git a/ts-price-service/Dockerfile b/ts-price-service/Dockerfile index 0c994fc0e..a7ea61521 100644 --- a/ts-price-service/Dockerfile +++ b/ts-price-service/Dockerfile @@ -1,8 +1,30 @@ -FROM java:8-jre +From maven:3.9.1-eclipse-temurin-8 as build + +WORKDIR /app + +COPY pom.xml pom.xml +COPY ts-common/pom.xml ts-common/pom.xml +# Remove all modules except ts-common +RUN sed -i "/\(ts-common\)<\/module>/!{/.*<\/module>/d}" pom.xml +RUN mvn dependency:go-offline -B + +ARG SERVICE_NAME=ts-price-service +# Add $SERVICE_NAME module +RUN sed -i "/ts-common<\/module>/a $SERVICE_NAME" pom.xml +COPY $SERVICE_NAME/pom.xml $SERVICE_NAME/pom.xml + +COPY ts-common/src ./ts-common/src +COPY $SERVICE_NAME/src ./$SERVICE_NAME/src + +RUN mvn package -DskipTests + +FROM eclipse-temurin:8-jre +ARG SERVICE_NAME=ts-price-service +ENV SERVICE_NAME=$SERVICE_NAME RUN /bin/cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai' >/etc/timezone -ADD ./target/ts-price-service-1.0.jar /app/ -CMD ["java", "-Xmx200m", "-jar", "/app/ts-price-service-1.0.jar"] +COPY --from=build /app/$SERVICE_NAME/target/$SERVICE_NAME-1.0.jar /app/ +CMD java -Xmx200m -jar /app/$SERVICE_NAME-1.0.jar EXPOSE 16579 \ No newline at end of file diff --git a/ts-price-service/Dockerfile.dockerignore b/ts-price-service/Dockerfile.dockerignore new file mode 100644 index 000000000..79be30c2c --- /dev/null +++ b/ts-price-service/Dockerfile.dockerignore @@ -0,0 +1,6 @@ +* +!/pom.xml +!/ts-common/pom.xml +!/ts-common/src +!/ts-price-service/pom.xml +!/ts-price-service/src diff --git a/ts-rebook-service/Dockerfile b/ts-rebook-service/Dockerfile index 79868eca0..128307a51 100644 --- a/ts-rebook-service/Dockerfile +++ b/ts-rebook-service/Dockerfile @@ -1,8 +1,30 @@ -FROM java:8-jre +From maven:3.9.1-eclipse-temurin-8 as build + +WORKDIR /app + +COPY pom.xml pom.xml +COPY ts-common/pom.xml ts-common/pom.xml +# Remove all modules except ts-common +RUN sed -i "/\(ts-common\)<\/module>/!{/.*<\/module>/d}" pom.xml +RUN mvn dependency:go-offline -B + +ARG SERVICE_NAME=ts-rebook-service +# Add $SERVICE_NAME module +RUN sed -i "/ts-common<\/module>/a $SERVICE_NAME" pom.xml +COPY $SERVICE_NAME/pom.xml $SERVICE_NAME/pom.xml + +COPY ts-common/src ./ts-common/src +COPY $SERVICE_NAME/src ./$SERVICE_NAME/src + +RUN mvn package -DskipTests + +FROM eclipse-temurin:8-jre +ARG SERVICE_NAME=ts-rebook-service +ENV SERVICE_NAME=$SERVICE_NAME RUN /bin/cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai' >/etc/timezone -ADD ./target/ts-rebook-service-1.0.jar /app/ -CMD ["java", "-Xmx200m", "-jar", "/app/ts-rebook-service-1.0.jar"] +COPY --from=build /app/$SERVICE_NAME/target/$SERVICE_NAME-1.0.jar /app/ +CMD java -Xmx200m -jar /app/$SERVICE_NAME-1.0.jar EXPOSE 18886 \ No newline at end of file diff --git a/ts-rebook-service/Dockerfile.dockerignore b/ts-rebook-service/Dockerfile.dockerignore new file mode 100644 index 000000000..335531d2d --- /dev/null +++ b/ts-rebook-service/Dockerfile.dockerignore @@ -0,0 +1,6 @@ +* +!/pom.xml +!/ts-common/pom.xml +!/ts-common/src +!/ts-rebook-service/pom.xml +!/ts-rebook-service/src diff --git a/ts-route-plan-service/Dockerfile b/ts-route-plan-service/Dockerfile index ffdb504c8..71b022f4c 100644 --- a/ts-route-plan-service/Dockerfile +++ b/ts-route-plan-service/Dockerfile @@ -1,8 +1,30 @@ -FROM java:8-jre +From maven:3.9.1-eclipse-temurin-8 as build + +WORKDIR /app + +COPY pom.xml pom.xml +COPY ts-common/pom.xml ts-common/pom.xml +# Remove all modules except ts-common +RUN sed -i "/\(ts-common\)<\/module>/!{/.*<\/module>/d}" pom.xml +RUN mvn dependency:go-offline -B + +ARG SERVICE_NAME=ts-route-plan-service +# Add $SERVICE_NAME module +RUN sed -i "/ts-common<\/module>/a $SERVICE_NAME" pom.xml +COPY $SERVICE_NAME/pom.xml $SERVICE_NAME/pom.xml + +COPY ts-common/src ./ts-common/src +COPY $SERVICE_NAME/src ./$SERVICE_NAME/src + +RUN mvn package -DskipTests + +FROM eclipse-temurin:8-jre +ARG SERVICE_NAME=ts-route-plan-service +ENV SERVICE_NAME=$SERVICE_NAME RUN /bin/cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai' >/etc/timezone -ADD ./target/ts-route-plan-service-1.0.jar /app/ -CMD ["java", "-Xmx200m", "-jar", "/app/ts-route-plan-service-1.0.jar"] +COPY --from=build /app/$SERVICE_NAME/target/$SERVICE_NAME-1.0.jar /app/ +CMD java -Xmx200m -jar /app/$SERVICE_NAME-1.0.jar EXPOSE 14578 \ No newline at end of file diff --git a/ts-route-plan-service/Dockerfile.dockerignore b/ts-route-plan-service/Dockerfile.dockerignore new file mode 100644 index 000000000..a3c0fd331 --- /dev/null +++ b/ts-route-plan-service/Dockerfile.dockerignore @@ -0,0 +1,6 @@ +* +!/pom.xml +!/ts-common/pom.xml +!/ts-common/src +!/ts-route-plan-service/pom.xml +!/ts-route-plan-service/src diff --git a/ts-route-service/Dockerfile b/ts-route-service/Dockerfile index 5327d62e7..b317d0eb7 100644 --- a/ts-route-service/Dockerfile +++ b/ts-route-service/Dockerfile @@ -1,8 +1,30 @@ -FROM java:8-jre +From maven:3.9.1-eclipse-temurin-8 as build + +WORKDIR /app + +COPY pom.xml pom.xml +COPY ts-common/pom.xml ts-common/pom.xml +# Remove all modules except ts-common +RUN sed -i "/\(ts-common\)<\/module>/!{/.*<\/module>/d}" pom.xml +RUN mvn dependency:go-offline -B + +ARG SERVICE_NAME=ts-route-service +# Add $SERVICE_NAME module +RUN sed -i "/ts-common<\/module>/a $SERVICE_NAME" pom.xml +COPY $SERVICE_NAME/pom.xml $SERVICE_NAME/pom.xml + +COPY ts-common/src ./ts-common/src +COPY $SERVICE_NAME/src ./$SERVICE_NAME/src + +RUN mvn package -DskipTests + +FROM eclipse-temurin:8-jre +ARG SERVICE_NAME=ts-route-service +ENV SERVICE_NAME=$SERVICE_NAME RUN /bin/cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai' >/etc/timezone -ADD ./target/ts-route-service-1.0.jar /app/ -CMD ["java", "-Xmx200m", "-jar", "/app/ts-route-service-1.0.jar"] +COPY --from=build /app/$SERVICE_NAME/target/$SERVICE_NAME-1.0.jar /app/ +CMD java -Xmx200m -jar /app/$SERVICE_NAME-1.0.jar EXPOSE 11178 \ No newline at end of file diff --git a/ts-route-service/Dockerfile.dockerignore b/ts-route-service/Dockerfile.dockerignore new file mode 100644 index 000000000..f039ac050 --- /dev/null +++ b/ts-route-service/Dockerfile.dockerignore @@ -0,0 +1,6 @@ +* +!/pom.xml +!/ts-common/pom.xml +!/ts-common/src +!/ts-route-service/pom.xml +!/ts-route-service/src diff --git a/ts-seat-service/Dockerfile b/ts-seat-service/Dockerfile index 92128650a..15543176b 100644 --- a/ts-seat-service/Dockerfile +++ b/ts-seat-service/Dockerfile @@ -1,8 +1,30 @@ -FROM java:8-jre +From maven:3.9.1-eclipse-temurin-8 as build + +WORKDIR /app + +COPY pom.xml pom.xml +COPY ts-common/pom.xml ts-common/pom.xml +# Remove all modules except ts-common +RUN sed -i "/\(ts-common\)<\/module>/!{/.*<\/module>/d}" pom.xml +RUN mvn dependency:go-offline -B + +ARG SERVICE_NAME=ts-seat-service +# Add $SERVICE_NAME module +RUN sed -i "/ts-common<\/module>/a $SERVICE_NAME" pom.xml +COPY $SERVICE_NAME/pom.xml $SERVICE_NAME/pom.xml + +COPY ts-common/src ./ts-common/src +COPY $SERVICE_NAME/src ./$SERVICE_NAME/src + +RUN mvn package -DskipTests + +FROM eclipse-temurin:8-jre +ARG SERVICE_NAME=ts-seat-service +ENV SERVICE_NAME=$SERVICE_NAME RUN /bin/cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai' >/etc/timezone -ADD ./target/ts-seat-service-1.0.jar /app/ -CMD ["java", "-Xmx200m", "-jar", "/app/ts-seat-service-1.0.jar"] +COPY --from=build /app/$SERVICE_NAME/target/$SERVICE_NAME-1.0.jar /app/ +CMD java -Xmx200m -jar /app/$SERVICE_NAME-1.0.jar EXPOSE 18898 \ No newline at end of file diff --git a/ts-seat-service/Dockerfile.dockerignore b/ts-seat-service/Dockerfile.dockerignore new file mode 100644 index 000000000..d1d14b326 --- /dev/null +++ b/ts-seat-service/Dockerfile.dockerignore @@ -0,0 +1,6 @@ +* +!/pom.xml +!/ts-common/pom.xml +!/ts-common/src +!/ts-seat-service/pom.xml +!/ts-seat-service/src diff --git a/ts-security-service/Dockerfile b/ts-security-service/Dockerfile index cd6b723b8..eb155b457 100644 --- a/ts-security-service/Dockerfile +++ b/ts-security-service/Dockerfile @@ -1,8 +1,30 @@ -FROM java:8-jre +From maven:3.9.1-eclipse-temurin-8 as build + +WORKDIR /app + +COPY pom.xml pom.xml +COPY ts-common/pom.xml ts-common/pom.xml +# Remove all modules except ts-common +RUN sed -i "/\(ts-common\)<\/module>/!{/.*<\/module>/d}" pom.xml +RUN mvn dependency:go-offline -B + +ARG SERVICE_NAME=ts-security-service +# Add $SERVICE_NAME module +RUN sed -i "/ts-common<\/module>/a $SERVICE_NAME" pom.xml +COPY $SERVICE_NAME/pom.xml $SERVICE_NAME/pom.xml + +COPY ts-common/src ./ts-common/src +COPY $SERVICE_NAME/src ./$SERVICE_NAME/src + +RUN mvn package -DskipTests + +FROM eclipse-temurin:8-jre +ARG SERVICE_NAME=ts-security-service +ENV SERVICE_NAME=$SERVICE_NAME RUN /bin/cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai' >/etc/timezone -ADD ./target/ts-security-service-1.0.jar /app/ -CMD ["java", "-Xmx200m", "-jar", "/app/ts-security-service-1.0.jar"] +COPY --from=build /app/$SERVICE_NAME/target/$SERVICE_NAME-1.0.jar /app/ +CMD java -Xmx200m -jar /app/$SERVICE_NAME-1.0.jar EXPOSE 11188 \ No newline at end of file diff --git a/ts-security-service/Dockerfile.dockerignore b/ts-security-service/Dockerfile.dockerignore new file mode 100644 index 000000000..26bd24224 --- /dev/null +++ b/ts-security-service/Dockerfile.dockerignore @@ -0,0 +1,6 @@ +* +!/pom.xml +!/ts-common/pom.xml +!/ts-common/src +!/ts-security-service/pom.xml +!/ts-security-service/src diff --git a/ts-station-food-service/Dockerfile b/ts-station-food-service/Dockerfile index 0fc92f341..6b9ddc742 100644 --- a/ts-station-food-service/Dockerfile +++ b/ts-station-food-service/Dockerfile @@ -1,8 +1,30 @@ -FROM java:8-jre +From maven:3.9.1-eclipse-temurin-8 as build + +WORKDIR /app + +COPY pom.xml pom.xml +COPY ts-common/pom.xml ts-common/pom.xml +# Remove all modules except ts-common +RUN sed -i "/\(ts-common\)<\/module>/!{/.*<\/module>/d}" pom.xml +RUN mvn dependency:go-offline -B + +ARG SERVICE_NAME=ts-station-food-service +# Add $SERVICE_NAME module +RUN sed -i "/ts-common<\/module>/a $SERVICE_NAME" pom.xml +COPY $SERVICE_NAME/pom.xml $SERVICE_NAME/pom.xml + +COPY ts-common/src ./ts-common/src +COPY $SERVICE_NAME/src ./$SERVICE_NAME/src + +RUN mvn package -DskipTests + +FROM eclipse-temurin:8-jre +ARG SERVICE_NAME=ts-station-food-service +ENV SERVICE_NAME=$SERVICE_NAME RUN /bin/cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai' >/etc/timezone -ADD ./target/ts-station-food-service-1.0.jar /app/ -CMD ["java", "-Xmx200m", "-jar", "/app/ts-station-food-service-1.0.jar"] +COPY --from=build /app/$SERVICE_NAME/target/$SERVICE_NAME-1.0.jar /app/ +CMD java -Xmx200m -jar /app/$SERVICE_NAME-1.0.jar EXPOSE 18855 diff --git a/ts-station-food-service/Dockerfile.dockerignore b/ts-station-food-service/Dockerfile.dockerignore new file mode 100644 index 000000000..712b0ecfb --- /dev/null +++ b/ts-station-food-service/Dockerfile.dockerignore @@ -0,0 +1,6 @@ +* +!/pom.xml +!/ts-common/pom.xml +!/ts-common/src +!/ts-station-food-service/pom.xml +!/ts-station-food-service/src diff --git a/ts-station-service/Dockerfile b/ts-station-service/Dockerfile index 9b9597390..c854193b0 100644 --- a/ts-station-service/Dockerfile +++ b/ts-station-service/Dockerfile @@ -1,8 +1,30 @@ -FROM java:8-jre +From maven:3.9.1-eclipse-temurin-8 as build + +WORKDIR /app + +COPY pom.xml pom.xml +COPY ts-common/pom.xml ts-common/pom.xml +# Remove all modules except ts-common +RUN sed -i "/\(ts-common\)<\/module>/!{/.*<\/module>/d}" pom.xml +RUN mvn dependency:go-offline -B + +ARG SERVICE_NAME=ts-station-service +# Add $SERVICE_NAME module +RUN sed -i "/ts-common<\/module>/a $SERVICE_NAME" pom.xml +COPY $SERVICE_NAME/pom.xml $SERVICE_NAME/pom.xml + +COPY ts-common/src ./ts-common/src +COPY $SERVICE_NAME/src ./$SERVICE_NAME/src + +RUN mvn package -DskipTests + +FROM eclipse-temurin:8-jre +ARG SERVICE_NAME=ts-station-service +ENV SERVICE_NAME=$SERVICE_NAME RUN /bin/cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai' >/etc/timezone -ADD ./target/ts-station-service-1.0.jar /app/ -CMD ["java", "-Xmx200m", "-jar", "/app/ts-station-service-1.0.jar"] +COPY --from=build /app/$SERVICE_NAME/target/$SERVICE_NAME-1.0.jar /app/ +CMD java -Xmx200m -jar /app/$SERVICE_NAME-1.0.jar EXPOSE 12345 \ No newline at end of file diff --git a/ts-station-service/Dockerfile.dockerignore b/ts-station-service/Dockerfile.dockerignore new file mode 100644 index 000000000..bcad812cd --- /dev/null +++ b/ts-station-service/Dockerfile.dockerignore @@ -0,0 +1,6 @@ +* +!/pom.xml +!/ts-common/pom.xml +!/ts-common/src +!/ts-station-service/pom.xml +!/ts-station-service/src diff --git a/ts-ticket-office-service/Dockerfile b/ts-ticket-office-service/Dockerfile index a74edb551..3192a9c20 100644 --- a/ts-ticket-office-service/Dockerfile +++ b/ts-ticket-office-service/Dockerfile @@ -5,13 +5,13 @@ RUN /bin/cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shang RUN mkdir -p /app WORKDIR /app -ADD ./node_modules /app/node_modules -ADD ./package.json /app/ -ADD ./public /app/public +ADD ./ts-ticket-office-service/node_modules /app/node_modules +ADD ./ts-ticket-office-service/package.json /app/ +ADD ./ts-ticket-office-service/public /app/public # RUN npm install -ADD ./bin /app/bin -ADD ./app.js /app/ +ADD ./ts-ticket-office-service/bin /app/bin +ADD ./ts-ticket-office-service/app.js /app/ CMD [ "npm", "start" ] EXPOSE 16108 \ No newline at end of file diff --git a/ts-train-food-service/Dockerfile b/ts-train-food-service/Dockerfile index de3c56173..2927a8f1e 100644 --- a/ts-train-food-service/Dockerfile +++ b/ts-train-food-service/Dockerfile @@ -1,8 +1,30 @@ -FROM java:8-jre +From maven:3.9.1-eclipse-temurin-8 as build + +WORKDIR /app + +COPY pom.xml pom.xml +COPY ts-common/pom.xml ts-common/pom.xml +# Remove all modules except ts-common +RUN sed -i "/\(ts-common\)<\/module>/!{/.*<\/module>/d}" pom.xml +RUN mvn dependency:go-offline -B + +ARG SERVICE_NAME=ts-train-food-service +# Add $SERVICE_NAME module +RUN sed -i "/ts-common<\/module>/a $SERVICE_NAME" pom.xml +COPY $SERVICE_NAME/pom.xml $SERVICE_NAME/pom.xml + +COPY ts-common/src ./ts-common/src +COPY $SERVICE_NAME/src ./$SERVICE_NAME/src + +RUN mvn package -DskipTests + +FROM eclipse-temurin:8-jre +ARG SERVICE_NAME=ts-train-food-service +ENV SERVICE_NAME=$SERVICE_NAME RUN /bin/cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai' >/etc/timezone -ADD ./target/ts-train-food-service-1.0.jar /app/ -CMD ["java", "-Xmx200m", "-jar", "/app/ts-train-food-service-1.0.jar"] +COPY --from=build /app/$SERVICE_NAME/target/$SERVICE_NAME-1.0.jar /app/ +CMD java -Xmx200m -jar /app/$SERVICE_NAME-1.0.jar EXPOSE 19999 diff --git a/ts-train-food-service/Dockerfile.dockerignore b/ts-train-food-service/Dockerfile.dockerignore new file mode 100644 index 000000000..bc7073f60 --- /dev/null +++ b/ts-train-food-service/Dockerfile.dockerignore @@ -0,0 +1,6 @@ +* +!/pom.xml +!/ts-common/pom.xml +!/ts-common/src +!/ts-train-food-service/pom.xml +!/ts-train-food-service/src diff --git a/ts-train-service/Dockerfile b/ts-train-service/Dockerfile index 6ac50c626..9167e6374 100644 --- a/ts-train-service/Dockerfile +++ b/ts-train-service/Dockerfile @@ -1,8 +1,30 @@ -FROM java:8-jre +From maven:3.9.1-eclipse-temurin-8 as build + +WORKDIR /app + +COPY pom.xml pom.xml +COPY ts-common/pom.xml ts-common/pom.xml +# Remove all modules except ts-common +RUN sed -i "/\(ts-common\)<\/module>/!{/.*<\/module>/d}" pom.xml +RUN mvn dependency:go-offline -B + +ARG SERVICE_NAME=ts-train-service +# Add $SERVICE_NAME module +RUN sed -i "/ts-common<\/module>/a $SERVICE_NAME" pom.xml +COPY $SERVICE_NAME/pom.xml $SERVICE_NAME/pom.xml + +COPY ts-common/src ./ts-common/src +COPY $SERVICE_NAME/src ./$SERVICE_NAME/src + +RUN mvn package -DskipTests + +FROM eclipse-temurin:8-jre +ARG SERVICE_NAME=ts-train-service +ENV SERVICE_NAME=$SERVICE_NAME RUN /bin/cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai' >/etc/timezone -ADD ./target/ts-train-service-1.0.jar /app/ -CMD ["java", "-Xmx200m", "-jar", "/app/ts-train-service-1.0.jar"] +COPY --from=build /app/$SERVICE_NAME/target/$SERVICE_NAME-1.0.jar /app/ +CMD java -Xmx200m -jar /app/$SERVICE_NAME-1.0.jar EXPOSE 14567 \ No newline at end of file diff --git a/ts-train-service/Dockerfile.dockerignore b/ts-train-service/Dockerfile.dockerignore new file mode 100644 index 000000000..1281d2e66 --- /dev/null +++ b/ts-train-service/Dockerfile.dockerignore @@ -0,0 +1,6 @@ +* +!/pom.xml +!/ts-common/pom.xml +!/ts-common/src +!/ts-train-service/pom.xml +!/ts-train-service/src diff --git a/ts-travel-plan-service/Dockerfile b/ts-travel-plan-service/Dockerfile index 414cf5ff0..57a0d1616 100644 --- a/ts-travel-plan-service/Dockerfile +++ b/ts-travel-plan-service/Dockerfile @@ -1,8 +1,30 @@ -FROM java:8-jre +From maven:3.9.1-eclipse-temurin-8 as build + +WORKDIR /app + +COPY pom.xml pom.xml +COPY ts-common/pom.xml ts-common/pom.xml +# Remove all modules except ts-common +RUN sed -i "/\(ts-common\)<\/module>/!{/.*<\/module>/d}" pom.xml +RUN mvn dependency:go-offline -B + +ARG SERVICE_NAME=ts-travel-plan-service +# Add $SERVICE_NAME module +RUN sed -i "/ts-common<\/module>/a $SERVICE_NAME" pom.xml +COPY $SERVICE_NAME/pom.xml $SERVICE_NAME/pom.xml + +COPY ts-common/src ./ts-common/src +COPY $SERVICE_NAME/src ./$SERVICE_NAME/src + +RUN mvn package -DskipTests + +FROM eclipse-temurin:8-jre +ARG SERVICE_NAME=ts-travel-plan-service +ENV SERVICE_NAME=$SERVICE_NAME RUN /bin/cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai' >/etc/timezone -ADD ./target/ts-travel-plan-service-1.0.jar /app/ -CMD ["java", "-Xmx200m", "-jar", "/app/ts-travel-plan-service-1.0.jar"] +COPY --from=build /app/$SERVICE_NAME/target/$SERVICE_NAME-1.0.jar /app/ +CMD java -Xmx200m -jar /app/$SERVICE_NAME-1.0.jar EXPOSE 14322 \ No newline at end of file diff --git a/ts-travel-plan-service/Dockerfile.dockerignore b/ts-travel-plan-service/Dockerfile.dockerignore new file mode 100644 index 000000000..c612967f1 --- /dev/null +++ b/ts-travel-plan-service/Dockerfile.dockerignore @@ -0,0 +1,6 @@ +* +!/pom.xml +!/ts-common/pom.xml +!/ts-common/src +!/ts-travel-plan-service/pom.xml +!/ts-travel-plan-service/src diff --git a/ts-travel-service/Dockerfile b/ts-travel-service/Dockerfile index 87c3aa255..aea84c5cd 100644 --- a/ts-travel-service/Dockerfile +++ b/ts-travel-service/Dockerfile @@ -1,8 +1,30 @@ -FROM java:8-jre +From maven:3.9.1-eclipse-temurin-8 as build + +WORKDIR /app + +COPY pom.xml pom.xml +COPY ts-common/pom.xml ts-common/pom.xml +# Remove all modules except ts-common +RUN sed -i "/\(ts-common\)<\/module>/!{/.*<\/module>/d}" pom.xml +RUN mvn dependency:go-offline -B + +ARG SERVICE_NAME=ts-travel-service +# Add $SERVICE_NAME module +RUN sed -i "/ts-common<\/module>/a $SERVICE_NAME" pom.xml +COPY $SERVICE_NAME/pom.xml $SERVICE_NAME/pom.xml + +COPY ts-common/src ./ts-common/src +COPY $SERVICE_NAME/src ./$SERVICE_NAME/src + +RUN mvn package -DskipTests + +FROM eclipse-temurin:8-jre +ARG SERVICE_NAME=ts-travel-service +ENV SERVICE_NAME=$SERVICE_NAME RUN /bin/cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai' >/etc/timezone -ADD ./target/ts-travel-service-1.0.jar /app/ -CMD ["java", "-Xmx200m", "-jar", "/app/ts-travel-service-1.0.jar"] +COPY --from=build /app/$SERVICE_NAME/target/$SERVICE_NAME-1.0.jar /app/ +CMD java -Xmx200m -jar /app/$SERVICE_NAME-1.0.jar EXPOSE 12346 \ No newline at end of file diff --git a/ts-travel-service/Dockerfile.dockerignore b/ts-travel-service/Dockerfile.dockerignore new file mode 100644 index 000000000..8c9d9df2a --- /dev/null +++ b/ts-travel-service/Dockerfile.dockerignore @@ -0,0 +1,6 @@ +* +!/pom.xml +!/ts-common/pom.xml +!/ts-common/src +!/ts-travel-service/pom.xml +!/ts-travel-service/src diff --git a/ts-travel2-service/Dockerfile b/ts-travel2-service/Dockerfile index 6609a14bc..6701ab5e5 100644 --- a/ts-travel2-service/Dockerfile +++ b/ts-travel2-service/Dockerfile @@ -1,8 +1,30 @@ -FROM java:8-jre +From maven:3.9.1-eclipse-temurin-8 as build + +WORKDIR /app + +COPY pom.xml pom.xml +COPY ts-common/pom.xml ts-common/pom.xml +# Remove all modules except ts-common +RUN sed -i "/\(ts-common\)<\/module>/!{/.*<\/module>/d}" pom.xml +RUN mvn dependency:go-offline -B + +ARG SERVICE_NAME=ts-travel2-service +# Add $SERVICE_NAME module +RUN sed -i "/ts-common<\/module>/a $SERVICE_NAME" pom.xml +COPY $SERVICE_NAME/pom.xml $SERVICE_NAME/pom.xml + +COPY ts-common/src ./ts-common/src +COPY $SERVICE_NAME/src ./$SERVICE_NAME/src + +RUN mvn package -DskipTests + +FROM eclipse-temurin:8-jre +ARG SERVICE_NAME=ts-travel2-service +ENV SERVICE_NAME=$SERVICE_NAME RUN /bin/cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai' >/etc/timezone -ADD ./target/ts-travel2-service-1.0.jar /app/ -CMD ["java", "-Xmx200m", "-jar", "/app/ts-travel2-service-1.0.jar"] +COPY --from=build /app/$SERVICE_NAME/target/$SERVICE_NAME-1.0.jar /app/ +CMD java -Xmx200m -jar /app/$SERVICE_NAME-1.0.jar EXPOSE 16346 \ No newline at end of file diff --git a/ts-travel2-service/Dockerfile.dockerignore b/ts-travel2-service/Dockerfile.dockerignore new file mode 100644 index 000000000..af0eacc10 --- /dev/null +++ b/ts-travel2-service/Dockerfile.dockerignore @@ -0,0 +1,6 @@ +* +!/pom.xml +!/ts-common/pom.xml +!/ts-common/src +!/ts-travel2-service/pom.xml +!/ts-travel2-service/src diff --git a/ts-ui-dashboard/Dockerfile b/ts-ui-dashboard/Dockerfile index c974d15b5..ec63c8f32 100644 --- a/ts-ui-dashboard/Dockerfile +++ b/ts-ui-dashboard/Dockerfile @@ -2,6 +2,6 @@ FROM openresty/openresty:trusty RUN /bin/cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai' >/etc/timezone -COPY nginx.conf /usr/local/openresty/nginx/conf/nginx.conf +COPY ts-ui-dashboard/nginx.conf /usr/local/openresty/nginx/conf/nginx.conf -COPY static /usr/share/nginx/html \ No newline at end of file +COPY ts-ui-dashboard/static /usr/share/nginx/html diff --git a/ts-user-service/Dockerfile b/ts-user-service/Dockerfile index f3835c3ce..8321e1c45 100644 --- a/ts-user-service/Dockerfile +++ b/ts-user-service/Dockerfile @@ -1,8 +1,30 @@ -FROM java:8-jre +From maven:3.9.1-eclipse-temurin-8 as build + +WORKDIR /app + +COPY pom.xml pom.xml +COPY ts-common/pom.xml ts-common/pom.xml +# Remove all modules except ts-common +RUN sed -i "/\(ts-common\)<\/module>/!{/.*<\/module>/d}" pom.xml +RUN mvn dependency:go-offline -B + +ARG SERVICE_NAME=ts-user-service +# Add $SERVICE_NAME module +RUN sed -i "/ts-common<\/module>/a $SERVICE_NAME" pom.xml +COPY $SERVICE_NAME/pom.xml $SERVICE_NAME/pom.xml + +COPY ts-common/src ./ts-common/src +COPY $SERVICE_NAME/src ./$SERVICE_NAME/src + +RUN mvn package -DskipTests + +FROM eclipse-temurin:8-jre +ARG SERVICE_NAME=ts-user-service +ENV SERVICE_NAME=$SERVICE_NAME RUN /bin/cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai' >/etc/timezone -ADD ./target/ts-user-service-1.0.jar /app/ -CMD ["java", "-Xmx200m", "-jar", "/app/ts-user-service-1.0.jar"] +COPY --from=build /app/$SERVICE_NAME/target/$SERVICE_NAME-1.0.jar /app/ +CMD java -Xmx200m -jar /app/$SERVICE_NAME-1.0.jar EXPOSE 12346 \ No newline at end of file diff --git a/ts-user-service/Dockerfile.dockerignore b/ts-user-service/Dockerfile.dockerignore new file mode 100644 index 000000000..45980d3ec --- /dev/null +++ b/ts-user-service/Dockerfile.dockerignore @@ -0,0 +1,6 @@ +* +!/pom.xml +!/ts-common/pom.xml +!/ts-common/src +!/ts-user-service/pom.xml +!/ts-user-service/src diff --git a/ts-verification-code-service/Dockerfile b/ts-verification-code-service/Dockerfile index c797703fd..d74e1ecdb 100644 --- a/ts-verification-code-service/Dockerfile +++ b/ts-verification-code-service/Dockerfile @@ -1,8 +1,30 @@ -FROM java:8-jre +From maven:3.9.1-eclipse-temurin-8 as build + +WORKDIR /app + +COPY pom.xml pom.xml +COPY ts-common/pom.xml ts-common/pom.xml +# Remove all modules except ts-common +RUN sed -i "/\(ts-common\)<\/module>/!{/.*<\/module>/d}" pom.xml +RUN mvn dependency:go-offline -B + +ARG SERVICE_NAME=ts-verification-code-service +# Add $SERVICE_NAME module +RUN sed -i "/ts-common<\/module>/a $SERVICE_NAME" pom.xml +COPY $SERVICE_NAME/pom.xml $SERVICE_NAME/pom.xml + +COPY ts-common/src ./ts-common/src +COPY $SERVICE_NAME/src ./$SERVICE_NAME/src + +RUN mvn package -DskipTests + +FROM eclipse-temurin:8-jre +ARG SERVICE_NAME=ts-verification-code-service +ENV SERVICE_NAME=$SERVICE_NAME RUN /bin/cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai' >/etc/timezone -ADD ./target/ts-verification-code-service-1.0.jar /app/ -CMD ["java", "-Xmx200m", "-jar", "/app/ts-verification-code-service-1.0.jar"] +COPY --from=build /app/$SERVICE_NAME/target/$SERVICE_NAME-1.0.jar /app/ +CMD java -Xmx200m -jar /app/$SERVICE_NAME-1.0.jar EXPOSE 15678 \ No newline at end of file diff --git a/ts-verification-code-service/Dockerfile.dockerignore b/ts-verification-code-service/Dockerfile.dockerignore new file mode 100644 index 000000000..c46cfa0f8 --- /dev/null +++ b/ts-verification-code-service/Dockerfile.dockerignore @@ -0,0 +1,6 @@ +* +!/pom.xml +!/ts-common/pom.xml +!/ts-common/src +!/ts-verification-code-service/pom.xml +!/ts-verification-code-service/src diff --git a/ts-voucher-service/Dockerfile b/ts-voucher-service/Dockerfile index f5f370097..63a9cbf70 100644 --- a/ts-voucher-service/Dockerfile +++ b/ts-voucher-service/Dockerfile @@ -5,11 +5,11 @@ RUN /bin/cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shang RUN mkdir -p /app WORKDIR /app -COPY requirements.txt ./ +COPY ts-voucher-service/requirements.txt ./ RUN pip install cryptography RUN pip install --no-cache-dir -r requirements.txt -ADD ./server.py /app/ +ADD ./ts-voucher-service/server.py /app/ CMD [ "python", "server.py" ] EXPOSE 16101 \ No newline at end of file diff --git a/ts-wait-order-service/Dockerfile b/ts-wait-order-service/Dockerfile index 5b88a2863..5f24868fe 100644 --- a/ts-wait-order-service/Dockerfile +++ b/ts-wait-order-service/Dockerfile @@ -1,8 +1,30 @@ -FROM java:8-jre +From maven:3.9.1-eclipse-temurin-8 as build + +WORKDIR /app + +COPY pom.xml pom.xml +COPY ts-common/pom.xml ts-common/pom.xml +# Remove all modules except ts-common +RUN sed -i "/\(ts-common\)<\/module>/!{/.*<\/module>/d}" pom.xml +RUN mvn dependency:go-offline -B + +ARG SERVICE_NAME=ts-wait-order-service +# Add $SERVICE_NAME module +RUN sed -i "/ts-common<\/module>/a $SERVICE_NAME" pom.xml +COPY $SERVICE_NAME/pom.xml $SERVICE_NAME/pom.xml + +COPY ts-common/src ./ts-common/src +COPY $SERVICE_NAME/src ./$SERVICE_NAME/src + +RUN mvn package -DskipTests + +FROM eclipse-temurin:8-jre +ARG SERVICE_NAME=ts-wait-order-service +ENV SERVICE_NAME=$SERVICE_NAME RUN /bin/cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai' >/etc/timezone -ADD ./target/ts-wait-order-service-1.0.jar /app/ -CMD ["java", "-Xmx200m", "-jar", "/app/ts-wait-order-service-1.0.jar"] +COPY --from=build /app/$SERVICE_NAME/target/$SERVICE_NAME-1.0.jar /app/ +CMD java -Xmx200m -jar /app/$SERVICE_NAME-1.0.jar EXPOSE 15678 \ No newline at end of file diff --git a/ts-wait-order-service/Dockerfile.dockerignore b/ts-wait-order-service/Dockerfile.dockerignore new file mode 100644 index 000000000..8ade5e1d9 --- /dev/null +++ b/ts-wait-order-service/Dockerfile.dockerignore @@ -0,0 +1,6 @@ +* +!/pom.xml +!/ts-common/pom.xml +!/ts-common/src +!/ts-wait-order-service/pom.xml +!/ts-wait-order-service/src