-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile
24 lines (20 loc) · 1.07 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
FROM amazoncorretto:20-alpine-jdk
ARG DATABASE_URL
ARG DATABASE_USERNAME
ARG DATABASE_PASSWORD
ARG JWT_SECRET_KEY
ARG JWT_EXPIRATION
COPY target/*.jar /app/app.jar
WORKDIR /app
# application.properties dosyasını oluştur
RUN echo "spring.datasource.url=$DATABASE_URL" > application.properties \
&& echo "spring.datasource.username=$DATABASE_USERNAME" >> application.properties \
&& echo "spring.datasource.password=$DATABASE_PASSWORD" >> application.properties \
&& echo "spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect" >> application.properties \
&& echo "spring.jpa.hibernate.ddl-auto=update" >> application.properties \
&& echo "spring.jpa.properties.javax.persistence.validation.mode=auto" >> application.properties \
&& echo "spring.jpa.hibernate.show-sql=true" >> application.properties \
&& echo "application.security.jwt.secret-key=$JWT_SECRET_KEY" >> application.properties \
&& echo "application.security.jwt.expiration=$JWT_EXPIRATION" >> application.properties
EXPOSE 8080
ENTRYPOINT ["java", "-jar", "app.jar"]