Click here to Skip to main content
15,867,453 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have a project with Spring Boot MVC and Mysql Database with dockerfile and docker-compose.yml and I want to push this project to the hub docker that to run every client as you know. but I couldn't this when I push to the hub docker and pull from the hub docker it doesn't work because connection refuesed and etc error happens. but in my device it work perfectly .

This is my Dockerfile:

FROM maven:3.8.2-jdk-11
WORKDIR /empmanagment-app
COPY . .
RUN mvn clean install
CMD mvn spring-boot:run


this is my docker-compose.yml

version: '3'
services:
    mysql-standalone:
        image: 'mysql:5.7'
        environment:
            - MYSQL_ROOT_PASSWORD=root
            - MYSQL_ROOT_USER=root
            - MYSQL_PASSWORD=root
            - MYSQL_DATABASE=elvin_emp_managment
        ports:
            - "3307:3306"
        networks:
            - common-network
        volumes:
            - mysql-standalone:/var/lib/mysql
    springboot-docker-container:
        build: ./
        image: anar1501/emp-managment
        ports:
            - "8080:8080"
        networks:
            - common-network
        environment:
            SPRING_DATASOURCE_URL: jdbc:mysql://mysql-standalone:3306/elvin_emp_managment?autoReconnect=true&useSSL=false
            SPRING_DATASOURCE_USERNAME: "root"
            SPRING_DATASOURCE_PASSWORD: "root"
        depends_on:
            - mysql-standalone
        volumes:
            - .m2:/root/.m2
volumes:
    mysql-standalone:
networks:
    common-network:
        driver: bridge


What I have tried:

I tried to push to the hub docker and when i pull from the docher hub it doesn't work. can anyone prefer any suggest?
Posted
Updated 28-Jan-23 11:47am

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900