Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CICD] mainImage, attachment 경로 mount 설정 #55

Merged
merged 2 commits into from
Sep 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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