jenkins_awscli

 

============================================

 

version: '3'
services:
        jenkins_awscli:
                restart: always
                image: ds/jenkins_cli:1.0
                volumes:
                        - ~/jenkins:/var/jenkins_home
                        - ~/.aws:/root/.aws
                ports:
                        - "8081:8080"
                        - "5000:5000"
                user: root

 

============================================

 

postgres

       위의 설정에 아래 설정을 그대로 이어서 붙어서 써준다.

 

============================================

 

       postgres:
                restart: always
                image: postgres
                environment:
                        - POSTGRES_USER=testuser
                        - POSTGRES_PASSWORD=testpass
                        - POSTGRES_DB=testbook
                ports:
                        - '5432:5432'
                volumes:
                        - ~/postgresql/data:/var/lib/postgresql/data

 

============================================

 

 

boot app 

        위의 설정에 아래설정을 그대로 이어서 붙어서 써준다.

============================================

 

 bootapp:
                image: openjdk:8-jdk-alpine
                restart: always
                container_name: "spring-boot-book"
                ports: -  "9765:9765"
                command: "java -jar app.jar --spring.config.location=file:///application-release.yml"

                environment:
                        -  "SPRING_PROFILES_ACTIVE=release"
                volumes:
                        - ~/boot/book/app:/usr/src/myapp
                        - ~/boot/book/env:/root/env
                        - ~/boot/book/log/spring:/log/spring

                        - ~/jenkins/workspace/git/bookReview/target/bookReview-0.0.1-bookReview.jar:/app.jar

                        - ~/properties/application-release.yml:/application-release.yml

 

               depends_on:

                        - postgres

============================================

 

- jar파일을 이어놓은이유는 따로 파일 옮길필요가 없이 바로 aws서버에서

도커명령어로 이미지를 만들기 위함이고

 

- application.yml도 이어놓은이유는

  깃이 퍼블릭으로 되어있는데 디비정보를 올릴수없어서 깃에는 기본 메모리db h2를 이용하게하고

  서버에 올려논 yml은 디비정보를 입력하여 디비에 접속가능하게함.

 

- java properties outside jar

- https://www.baeldung.com/spring-properties-file-outside-jar

 

Spring Properties File Outside jar | Baeldung

Learn how to load Spring properties from outside the jar package

www.baeldung.com

https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#boot-features-external-config-application-property-files

 

Spring Boot Reference Documentation

This section goes into more detail about how you should use Spring Boot. It covers topics such as build systems, auto-configuration, and how to run your applications. We also cover some Spring Boot best practices. Although there is nothing particularly spe

docs.spring.io

docker-compose 

 

자세한설명 : 

https://www.44bits.io/ko/post/almost-perfect-development-environment-with-docker-and-docker-compose#docker-compose.yml-%ED%8C%8C%EC%9D%BC

 

도커(Docker) 컴포즈를 활용하여 완벽한 개발 환경 구성하기

개발 환경을 구축하기란 그리 쉬운 일이 아닙니다. 문서화를 해두어도 누군가 계속 신경쓰지 않으면 내용이 낡기 마련이고, 계속 신경 쓰자니 이 또한 쉽지 않죠. 어떻게 하면 손쉽게 개발 환경�

www.44bits.io

 

 

docker-compose postgresql 

 

https://www.javacodegeeks.com/2020/03/docker-compose-for-spring-boot-application-with-postgresql.html

 

Docker Compose for Spring Boot application with PostgreSQL | Java Code Geeks - 2020

Interested to learn about Docker Compose? Check our article explaining how to configure Spring Boot application with PostgreSQL to run with Docker Compose

www.javacodegeeks.com

 

https://siner308.github.io/2019/03/02/postgres-docker-compose/

 

포스트그레스(PostgreSQL)로 설명하는 도커 컴포즈(Docker Compose) 초간단 사용법 - Siner's DevLog

이번 장에서는 Docker Compose의 일반적인 사용방법과, 이를 사용하여 PostgreSQL을 배포하는 방법에 대해서 설명하겠습니다. 0) Compose란? Overview of Docker Compose Compose란 여러개의 도커 컨테이너들을 한꺼

siner308.github.io

 

https://docs.docker.com/engine/examples/postgresql_service/

 

Dockerize PostgreSQL

Install PostgreSQL on Docker Assuming there is no Docker image that suits your needs on the Docker Hub, you can create one yourself. Start by creating a new Dockerfile: Note:...

docs.docker.com

 

'개발 > docker' 카테고리의 다른 글

Docker Image  (0) 2021.03.05
Linux Container  (0) 2021.03.03
DOCKERFILE  (0) 2020.03.01
내가 자주쓰는 docker 명령어  (0) 2020.02.23
centos 7 docker 설치  (0) 2020.02.23

+ Recent posts