美文网首页
docker-springboot配置及部署

docker-springboot配置及部署

作者: 独孤流 | 来源:发表于2019-03-01 16:11 被阅读0次

    springboot里配置的Dockerfile

    FROM openjdk:8-jdk-alpine
    VOLUME /tmp
    #ADD spring-boot-docker-1.0.jar app.jar
    #ADD docker-0.0.1.jar app.jar
    ADD *.jar app.jar
    ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"]
    

    redis:
    config set requirepass 密码
    auth 密码
    config get requirepass
    本地登录:redis-cli
    远程登录:redis-cli -h xxxx.xx.xxx.xx -p xxxx -a 密码

    pom.xml配置

    <!--参数配置-->
        <properties>
            <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
            <java.version>1.8</java.version>
            <docker.image.prefix>springboot</docker.image.prefix>
        </properties>
    
        <!--编译插件-->
         <plugins>
                <!--maven plugin-->
                <plugin>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-maven-plugin</artifactId>
                </plugin>
                <!--docker plugin-->
                <plugin>
                    <groupId>com.spotify</groupId>
                    <artifactId>docker-maven-plugin</artifactId>
                    <version>1.0.0</version>
                    <configuration>
                        <imageName>${docker.image.prefix}/${project.artifactId}</imageName>
                        <dockerDirectory>src/main/docker</dockerDirectory>
                        <resources>
                            <resource>
                                <targetPath>/</targetPath>
                                <directory>${project.build.directory}</directory>
                                <include>${project.build.finalName}.jar</include>
                            </resource>
                        </resources>
                    </configuration>
                </plugin>
            </plugins>
    

    【docker-compose】使用docker-compose部署运行spring boot+mysql

    Docker之Compose服务编排

    相关文章

      网友评论

          本文标题:docker-springboot配置及部署

          本文链接:https://www.haomeiwen.com/subject/xlwduqtx.html