Skip to content

Commit

Permalink
feat #13: CI/CD를 위한 docker 설정
Browse files Browse the repository at this point in the history
  • Loading branch information
GiHoo committed Apr 8, 2024
1 parent 8c20d6a commit 84f5e97
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FROM openjdk:17
ARG JAR_FILE=./build/libs/caps-be-0.0.1-SNAPSHOT.jar
COPY ${JAR_FILE} app.jar
ENTRYPOINT ["java","-jar","/app.jar", "--spring.profiles.active=prod"]
29 changes: 29 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
version: "3" # 버전 지정

services: # 컨테이너 설정
database:
container_name: mysql # 컨테이너 이름
image: mysql/mysql-server:latest # 컨테이너에서 사용하는 base image 지정
environment: # 컨테이너 안의 환경변수 설정
MYSQL_DATABASE: caps-rds
MYSQL_USER: admin
MYSQL_PASSWORD: admin1234
MYSQL_ROOT_HOST: '%'
MYSQL_ROOT_PASSWORD: rootpwd
command: # 명령어 설정
- --default-authentication-plugin=mysql_native_password
ports: # 접근 포트 설정
- 3305:3306 # Host:Container
networks:
- db_network
restart: always # 컨테이너 실행 시 재시작
mytamla:
build: .
expose:
- 8080
depends_on:
- database

networks: # 커스텀 네트워크 추가
db_network: # 네트워크 이름
driver: bridge

0 comments on commit 84f5e97

Please sign in to comment.