# All six services on one network: mvn -DskipTests package && docker compose up --build # NOT RUN when this repository was written (no Docker in the sandbox). The same system was run as plain jars with # scripts/start.sh, and everything in output/ comes from that. Inside the compose network the services reach each # other by service name, so only the three environment variables below differ from the jar run. x-service: &service restart: on-failure # a service that starts before the config server is up exits and is retried environment: &env CONFIG_URL: http://config-server:8888 EUREKA_URL: http://discovery-server:8761/eureka services: config-server: build: { context: ., args: { SERVICE: config-server } } ports: ["8888:8888"] discovery-server: build: { context: ., args: { SERVICE: discovery-server } } ports: ["8761:8761"] environment: { EUREKA_HOSTNAME: discovery-server } product-service: <<: *service build: { context: ., args: { SERVICE: product-service } } environment: { <<: *env, EUREKA_HOSTNAME: product-service } depends_on: [config-server, discovery-server] inventory-service: <<: *service build: { context: ., args: { SERVICE: inventory-service } } environment: { <<: *env, EUREKA_HOSTNAME: inventory-service } depends_on: [config-server, discovery-server] order-service: <<: *service build: { context: ., args: { SERVICE: order-service } } environment: { <<: *env, EUREKA_HOSTNAME: order-service } depends_on: [config-server, discovery-server] gateway: <<: *service build: { context: ., args: { SERVICE: gateway } } environment: { <<: *env, EUREKA_HOSTNAME: gateway } ports: ["8080:8080"] depends_on: [config-server, discovery-server]