diff --git a/springBank/springBankApp/docker-compose.yml b/springBank/springBankApp/docker-compose.yml index 19ef4f7ec..2b2b3faaa 100644 --- a/springBank/springBankApp/docker-compose.yml +++ b/springBank/springBankApp/docker-compose.yml @@ -6,10 +6,9 @@ services: working_dir: /app volumes: - .:/app + - ~/.m2/repository:/root/.m2/repository # Mount Maven local repository ports: - "9999:9999" -# expose: -# - "9999" environment: - SPRING_DATASOURCE_URL=jdbc:mysql://mysql:3306/spring_bank - SPRING_DATASOURCE_USERNAME=root @@ -19,8 +18,12 @@ services: - SPRING_JPA_HIBERNATE_DDL_AUTO=create # Set the Hibernate ddl-auto property here - SPRING_JPA_GENERATE_DDL=true - SERVER_PORT=9999 + - SPRING_REDIS_HOST=redis # Set Redis host + - SPRING_REDIS_PORT=6379 + - REDIS_URL=redis://redis:6379 depends_on: - mysql + - redis command: mvn clean spring-boot:run -DskipTests app2: @@ -29,10 +32,9 @@ services: working_dir: /app volumes: - .:/app + - ~/.m2/repository:/root/.m2/repository # Mount Maven local repository ports: - "9998:9998" -# expose: -# - "9998" environment: - SPRING_DATASOURCE_URL=jdbc:mysql://mysql:3306/spring_bank - SPRING_DATASOURCE_USERNAME=root @@ -42,20 +44,25 @@ services: - SPRING_JPA_HIBERNATE_DDL_AUTO=create # Set the Hibernate ddl-auto property here - SPRING_JPA_GENERATE_DDL=true - SERVER_PORT=9998 + - SPRING_REDIS_HOST=redis # Set Redis host + - SPRING_REDIS_PORT=6379 + - REDIS_URL=redis://redis:6379 depends_on: - mysql + - redis command: mvn clean spring-boot:run -DskipTests - # nginx: - # image: nginx - # restart: always - # ports: - # - "8080:80" - # volumes: - # - ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro - # depends_on: - # - app1 - # - app2 + nginx: + image: nginx + restart: always + ports: + - "8080:8080" + volumes: + - ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro + - ./nginx/index.html:/app/html:ro + depends_on: + - app1 + - app2 mysql: image: mysql:5.7 @@ -68,6 +75,11 @@ services: - "3306:3306" volumes: - mysql-data:/var/lib/mysql + redis: + image: redis:latest + restart: always + ports: + - "6379:6379" # Expose Redis port volumes: - mysql-data: + mysql-data: \ No newline at end of file