-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
68 lines (63 loc) · 2.35 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
FROM amazoncorretto:22
# 빌드 시 인자를 받기 위한 ARG 설정
ARG SPRING_DATASOURCE_URL
ARG SPRING_DATASOURCE_USERNAME
ARG SPRING_DATASOURCE_PASSWORD
ARG REDIS_HOST
ARG REDIS_PORT
ARG JWT_SECRET_KEY
ARG JWT_ACCESS_TOKEN_EXPIRATION_TIME
ARG JWT_REFRESH_TOKEN_EXPIRATION_TIME
ARG AWS_S3_BUCKET
ARG AWS_REGION
ARG AWS_ACCESS_KEY
ARG AWS_SECRET_KEY
ARG IMP_API_KEY
ARG IMP_SECRET_KEY
ARG KAKAO_CLIENT_ID
ARG KAKAO_CLIENT_SECRET
ARG NAVER_OCR_SECRET
ARG NAVER_OCR_INVOKE
ARG NAVER_OCR_TEMPLATE
# 환경 변수 설정
ENV SPRING_DATASOURCE_URL=$SPRING_DATASOURCE_URL
ENV SPRING_DATASOURCE_USERNAME=$SPRING_DATASOURCE_USERNAME
ENV SPRING_DATASOURCE_PASSWORD=$SPRING_DATASOURCE_PASSWORD
ENV REDIS_HOST=$REDIS_HOST
ENV REDIS_PORT=$REDIS_PORT
ENV JWT_SECRET_KEY=$JWT_SECRET_KEY
ENV JWT_ACCESS_TOKEN_EXPIRATION_TIME=$JWT_ACCESS_TOKEN_EXPIRATION_TIME
ENV JWT_REFRESH_TOKEN_EXPIRATION_TIME=$JWT_REFRESH_TOKEN_EXPIRATION_TIME
ENV AWS_S3_BUCKET=$AWS_S3_BUCKET
ENV AWS_REGION=$AWS_REGION
ENV AWS_ACCESS_KEY=$AWS_ACCESS_KEY
ENV AWS_SECRET_KEY=$AWS_SECRET_KEY
ENV IMP_API_KEY=$IMP_API_KEY
ENV IMP_SECRET_KEY=$IMP_SECRET_KEY
ENV KAKAO_CLIENT_ID=$KAKAO_CLIENT_ID
ENV KAKAO_CLIENT_SECRET=$KAKAO_CLIENT_SECRET
ENV NAVER_OCR_SECRET=$NAVER_OCR_SECRET
ENV NAVER_OCR_INVOKE=$NAVER_OCR_INVOKE
ENV NAVER_OCR_TEMPLATE=$NAVER_OCR_TEMPLATE
COPY build/libs/*.jar app.jar
ENTRYPOINT ["java", "-Duser.timezone=Asia/Seoul", \
"-Dspring.datasource.url=${SPRING_DATASOURCE_URL}", \
"-Dspring.datasource.username=${SPRING_DATASOURCE_USERNAME}", \
"-Dspring.datasource.password=${SPRING_DATASOURCE_PASSWORD}", \
"-Dspring.redis.host=${REDIS_HOST}", \
"-Dspring.redis.port=${REDIS_PORT}", \
"-Djwt.secret=${JWT_SECRET_KEY}", \
"-Djwt.access-token-expiration-time=${JWT_ACCESS_TOKEN_EXPIRATION_TIME}", \
"-Djwt.refresh-token-expiration-time=${JWT_REFRESH_TOKEN_EXPIRATION_TIME}", \
"-Daws.s3.bucket=${AWS_S3_BUCKET}", \
"-Daws.region=${AWS_REGION}", \
"-Daws.access=${AWS_ACCESS_KEY}", \
"-Daws.secret=${AWS_SECRET_KEY}", \
"-Dimp.api.key=${IMP_API_KEY}", \
"-Dimp.api.secretKey=${IMP_SECRET_KEY}", \
"-Dkakao.client.id=${KAKAO_CLIENT_ID}", \
"-Dkakao.client.secret=${KAKAO_CLIENT_SECRET}", \
"-Dnaver.ocr.secret=${NAVER_OCR_SECRET}", \
"-Dnaver.ocr.invoke=${NAVER_OCR_INVOKE}", \
"-Dnaver.ocr.template=${NAVER_OCR_TEMPLATE}", \
"-jar", "/app.jar"]