Skip to content

Commit

Permalink
[CICD] mainImage, attachment 경로 mount 설정 (#55)
Browse files Browse the repository at this point in the history
* CICD: Add mainImage, attachment directory for mounting

* CICD: Add volumes to mount with server directory. (for attachment)
  • Loading branch information
huGgW authored Sep 3, 2023
1 parent d546a9f commit 6f23b0e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
FROM openjdk:17-slim

# Set profile
ARG PROFILE
ENV profile=$PROFILE

# Set workdir as /app
RUN mkdir /app
WORKDIR /app

# Copy jar file
COPY ./build/libs/*.jar /app/app.jar

# Make directories to mount
RUN mkdir /app/mainImage
RUN mkdir /app/attachment

# Expose port 8080
EXPOSE 8080

ENTRYPOINT java -Dspring.profiles.active=$profile -jar app.jar
6 changes: 6 additions & 0 deletions docker-compose-backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ services:
PROFILE: ${PROFILE}
ports:
- 8080:8080
volumes:
- ./mainImage:/app/mainImage
- ./attachment:/app/attachment
environment:
SPRING_DATASOURCE_URL: "jdbc:mysql://host.docker.internal:3306/${MYSQL_DATABASE}?serverTimezone=Asia/Seoul&useSSL=false&allowPublicKeyRetrieval=true"
SPRING_DATASOURCE_USERNAME: ${MYSQL_USER}
Expand All @@ -25,6 +28,9 @@ services:
# PROFILE: ${PROFILE}
# ports:
# - 8081:8080
# volumes:
# - ./mainImage:/app/mainImage
# - ./attachment:/app/attachment
# environment:
# SPRING_DATASOURCE_URL: "jdbc:mysql://host.docker.internal:3306/${MYSQL_DATABASE}?serverTimezone=Asia/Seoul&useSSL=false&allowPublicKeyRetrieval=true"
# SPRING_DATASOURCE_USERNAME: ${MYSQL_USER}
Expand Down

0 comments on commit 6f23b0e

Please sign in to comment.