Skip to content

4L 회고 / 2023-09-07 #38

@Felicette1963

Description

@Felicette1963

좋았던 것(Liked)

  • 없음

배운 것(Learned)

  1. 도커
  • 스프링 부트 구현 및 실행환경 설정
    (1) DockerFile 생성
# 클라우드 환경 설정 unbuntu 버전
From ubuntu:22.04

# 자바 실행 파일 jar를 저장할 디렉토리를 도커가 생성 실행파일을 여기에 저장
WORKDIR /my_boot

# 작업했던 파일들을 복사 my_boot에 복사
# COPY . (현재폴더 pom.xml이 있는 폴더에서 실행) . (작업폴더 /my_boot)
# 공백주의
COPY . .

############### 실행 환경 설정 명령 ##############
RUN apt update
RUN apt install openjdk-11-jre-headless -y
RUN apt install maven -y
RUN mvn package -Dmaven.test.skep=true

# 사용할 포트 설정
EXPOSE 8080

# 사용할 명령어 설정
ENTRYPOINT ["java", "-jar", "/my_boot/target/hello-0.0.1-SNAPSHOT.jar"]

(2) E2C 서버 생성 후 도커 설정

apt-get install docker.io
chmod -R 777 [스프링 폴더]
cd [도커 파일 위치]
docker build -t [환경설정 파일 이름] .

부족했던 것(Lacked)

  • 없음

바라는 것(Longed for)

  • 없음

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions