Kaynağa Gözat

feat(up): 添加docker-compose 一键启动

魏宏斌 3 yıl önce
ebeveyn
işleme
e2bd68e741
4 değiştirilmiş dosya ile 267 ekleme ve 0 silme
  1. 203 0
      .dockerignore
  2. 19 0
      Dockerfile.agent
  3. 22 0
      Dockerfile.server
  4. 23 0
      docker-compose.yml

+ 203 - 0
.dockerignore

@@ -0,0 +1,203 @@
+### Maven template
+target/
+pom.xml.tag
+pom.xml.releaseBackup
+pom.xml.versionsBackup
+pom.xml.next
+release.properties
+dependency-reduced-pom.xml
+buildNumber.properties
+.mvn/timing.properties
+# https://github.com/takari/maven-wrapper#usage-without-binary-jar
+.mvn/wrapper/maven-wrapper.jar
+
+### JetBrains template
+# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
+# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
+
+# User-specific stuff
+.idea/**/workspace.xml
+.idea/**/tasks.xml
+.idea/**/usage.statistics.xml
+.idea/**/dictionaries
+.idea/**/shelf
+
+# Generated files
+.idea/**/contentModel.xml
+
+# Sensitive or high-churn files
+.idea/**/dataSources/
+.idea/**/dataSources.ids
+.idea/**/dataSources.local.xml
+.idea/**/sqlDataSources.xml
+.idea/**/dynamic.xml
+.idea/**/uiDesigner.xml
+.idea/**/dbnavigator.xml
+
+# Gradle
+.idea/**/gradle.xml
+.idea/**/libraries
+
+# Gradle and Maven with auto-import
+# When using Gradle or Maven with auto-import, you should exclude module files,
+# since they will be recreated, and may cause churn.  Uncomment if using
+# auto-import.
+# .idea/artifacts
+# .idea/compiler.xml
+# .idea/jarRepositories.xml
+# .idea/modules.xml
+# .idea/*.iml
+# .idea/modules
+# *.iml
+# *.ipr
+
+# CMake
+cmake-build-*/
+
+# Mongo Explorer plugin
+.idea/**/mongoSettings.xml
+
+# File-based project format
+*.iws
+
+# IntelliJ
+out/
+
+# mpeltonen/sbt-idea plugin
+.idea_modules/
+
+# JIRA plugin
+atlassian-ide-plugin.xml
+
+# Cursive Clojure plugin
+.idea/replstate.xml
+
+# Crashlytics plugin (for Android Studio and IntelliJ)
+com_crashlytics_export_strings.xml
+crashlytics.properties
+crashlytics-build.properties
+fabric.properties
+
+# Editor-based Rest Client
+.idea/httpRequests
+
+# Android studio 3.1+ serialized cache file
+.idea/caches/build_file_checksums.ser
+
+### Node template
+# Logs
+logs
+*.log
+npm-debug.log*
+yarn-debug.log*
+yarn-error.log*
+lerna-debug.log*
+
+# Diagnostic reports (https://nodejs.org/api/report.html)
+report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
+
+# Runtime data
+pids
+*.pid
+*.seed
+*.pid.lock
+
+# Directory for instrumented libs generated by jscoverage/JSCover
+lib-cov
+
+# Coverage directory used by tools like istanbul
+coverage
+*.lcov
+
+# nyc test coverage
+.nyc_output
+
+# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
+.grunt
+
+# Bower dependency directory (https://bower.io/)
+bower_components
+
+# node-waf configuration
+.lock-wscript
+
+# Compiled binary addons (https://nodejs.org/api/addons.html)
+build/Release
+
+# Dependency directories
+node_modules/
+jspm_packages/
+
+# Snowpack dependency directory (https://snowpack.dev/)
+web_modules/
+
+# TypeScript cache
+*.tsbuildinfo
+
+# Optional npm cache directory
+.npm
+
+# Optional eslint cache
+.eslintcache
+
+# Microbundle cache
+.rpt2_cache/
+.rts2_cache_cjs/
+.rts2_cache_es/
+.rts2_cache_umd/
+
+# Optional REPL history
+.node_repl_history
+
+# Output of 'npm pack'
+*.tgz
+
+# Yarn Integrity file
+.yarn-integrity
+
+# dotenv environment variables file
+.env
+.env.test
+
+# parcel-bundler cache (https://parceljs.org/)
+.cache
+.parcel-cache
+
+# Next.js build output
+.next
+out
+
+# Nuxt.js build / generate output
+.nuxt
+dist
+
+# Gatsby files
+.cache/
+# Comment in the public line in if your project uses Gatsby and not Next.js
+# https://nextjs.org/blog/next-9-1#public-directory-support
+# public
+
+# vuepress build output
+.vuepress/dist
+
+# Serverless directories
+.serverless/
+
+# FuseBox cache
+.fusebox/
+
+# DynamoDB Local files
+.dynamodb/
+
+# TernJS port file
+.tern-port
+
+# Stores VSCode versions used for testing VSCode extensions
+.vscode-test
+
+# yarn v2
+.yarn/cache
+.yarn/unplugged
+.yarn/build-state.yml
+.yarn/install-state.gz
+.pnp.*

+ 19 - 0
Dockerfile.agent

@@ -0,0 +1,19 @@
+FROM maven:3.8.4-jdk-8-slim as builder
+WORKDIR /target/dependency
+COPY . .
+
+RUN curl -o settings.xml https://ldl-oss-bucket.oss-cn-shanghai.aliyuncs.com/release/settings.xml
+RUN mvn -B -e -T 1C clean package -pl modules/agent -am -Dmaven.test.skip=true -Dmaven.compile.fork=true -s settings.xml
+
+FROM maven:3.8.4-jdk-8-slim
+ENV JPOM_HOME	/usr/local/jpom-agent
+ENV JPOM_PKG    agent-2.8.0-release
+WORKDIR $JPOM_HOME
+ARG DEPENDENCY=/target/dependency
+COPY --from=builder ${DEPENDENCY}/modules/agent/target/${JPOM_PKG} ${JPOM_HOME}
+
+VOLUME $JPOM_HOME
+EXPOSE 2123
+
+ENTRYPOINT ["/bin/bash", "Agent.sh", "start"]
+

+ 22 - 0
Dockerfile.server

@@ -0,0 +1,22 @@
+FROM maven:3.8.4-jdk-8-slim as builder
+WORKDIR /target/dependency
+COPY . .
+RUN apt-get update && apt-get install -y npm
+RUN npm config set registry https://registry.npmmirror.com
+RUN cd web-vue && npm install && npm run build
+RUN curl -o settings.xml https://ldl-oss-bucket.oss-cn-shanghai.aliyuncs.com/release/settings.xml
+RUN mvn -B -e -T 1C clean package -pl modules/server -am -Dmaven.test.skip=true -Dmaven.compile.fork=true -s settings.xml
+
+FROM maven:3.8.4-jdk-8-slim
+ENV JPOM_HOME   /usr/local/jpom-server
+ENV JPOM_PKG    server-2.8.0-release
+WORKDIR $JPOM_HOME
+ARG DEPENDENCY=/target/dependency
+COPY --from=builder ${DEPENDENCY}/modules/server/target/${JPOM_PKG} ${JPOM_HOME}
+
+VOLUME $JPOM_HOME
+EXPOSE 2122
+
+ENTRYPOINT ["/bin/bash", "Server.sh", "start"]
+
+

+ 23 - 0
docker-compose.yml

@@ -0,0 +1,23 @@
+version: '3.8'
+services:
+  server:
+    image: jpom_server:2.8.0
+    build:
+      dockerfile: Dockerfile.server
+      context: .
+    volumes:
+      - jpom-server:/usr/local/jpom-server
+    ports:
+      - "2122:2122"
+  agent:
+    image: jpom_agent:2.8.0
+    build:
+      dockerfile: Dockerfile.agent
+      context: .
+    volumes:
+      - jpom-agent:/usr/local/jpom-agent
+    ports:
+      - "2123:2123"
+volumes:
+  jpom-agent:
+  jpom-server: