Local micro-service test - Local docker registry and problems encountered

  • Demand, we also need to be tested locally from now on, especially after a single service test is completed, the need for local service registration and local monitoring.
  1. Service Registration - consul registered local docker service deployment

Docker port to communicate with an external host is dokcer0, which is 172.17.0.1, whether this can replace localhost local testing, monitoring whether the service can be so: application-dev.yml examples

server:
  port: 8224
spring:
  application:
    name: micro-apk
  cloud:
    consul:
      host: 172.17.0.1
      port: 8500
      discovery:
        service-name: ${spring.application.name}
        health-check-url: http://172.17.0.1:8224/actuator/health
        hostname: 172.17.0.1
  boot:
    admin:
      client:
        url: "http://172.17.0.1:8220"

This proved to be successful
2. The two-dimensional code intermediate picture association

Set by the docker container for storing pictures directories and directory outside world is completely fragmented, should add a container in the docker

FROM java:8
MAINTAINER lidengyin
ARG JAR_FILE
ADD ${JAR_FILE} micro-apk.jar
ADD ./simsun.ttc /usr/share/fonts
ADD ./hc_logo.png /usr/local
EXPOSE 8224
ENTRYPOINT ["java","-jar","micro-apk.jar"]
  1. I now feel docker network is a very important place
Published 111 original articles · won praise 59 · views 10000 +

Guess you like

Origin blog.csdn.net/weixin_43404791/article/details/105238523