Skip to content

Commit

Permalink
create Heroku database info to work with container
Browse files Browse the repository at this point in the history
  • Loading branch information
ichbinorange committed Feb 15, 2021
1 parent dbd313f commit 409f048
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ VOLUME /tmp
ARG JAR_FILE=build/libs/\*.jar
COPY ${JAR_FILE} app.jar

ENTRYPOINT ["java", "-Dspring.security.oauth2.client.registration.google.client-id='${GOOGLE_OAUTH_CLIENT_ID}'", "-Dspring.security.oauth2.client.registration.google.client-secret='${GOOGLE_OAUTH_CLIENT_SECRET}'","-Dspring.datasource.url=jdbc:postgresql://ec2-54-225-190-241.compute-1.amazonaws.com:5432/d5cfl02tlmjad?user=fydstdjbhenvak&password=f1f657929a4002d5a59e78043d9ca6e77c5f112a18047b0db6ffb92742c1a225","-Dserver.port=$PORT","-jar","/app.jar"]
ENTRYPOINT ["java", "-Dspring.security.oauth2.client.registration.google.client-id='${GOOGLE_OAUTH_CLIENT_ID}'", "-Dspring.security.oauth2.client.registration.google.client-secret='${GOOGLE_OAUTH_CLIENT_SECRET}'","-Dspring.datasource.url='${HEROKU_PSQLDB}'","-Dserver.port=$PORT","-jar","/app.jar"]

EXPOSE $PORT
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ test {
}

bootRun {
// systemProperty 'spring.datasource.url', findProperty('HEROKU_PSQLDB')
// for local use
systemProperty 'spring.security.oauth2.client.registration.google.client-id', findProperty('GOOGLE_CLIENT_ID')
systemProperty 'spring.security.oauth2.client.registration.google.client-secret', findProperty('GOOGLE_CLIENT_SECRET')
}
10 changes: 5 additions & 5 deletions src/main/resources/application.properties
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# For local use
server.port=3000
spring.datasource.url=jdbc:postgresql://localhost:5432/habitbuilder
#server.port=3000
#spring.datasource.url=jdbc:postgresql://localhost:5432/habitbuilder

# For heroku deployment use
#spring.datasource.driverClassName=org.postgresql.Driver
#server.port=${PORT}
spring.datasource.driverClassName=org.postgresql.Driver
server.port=${PORT}

spring.datasource.username=
spring.datasource.password=

# create-drop --> for heroku deploy
spring.jpa.hibernate.ddl-auto=update
spring.jpa.hibernate.ddl-auto=create-drop
spring.jpa.show-sql=true
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
spring.jpa.properties.hibernate.format_sql=true
Expand Down

0 comments on commit 409f048

Please sign in to comment.