Merge pull request 'adding compose for launching properly everything' (#151) from tonitch/compose into master
Some checks failed
Build and test backend / Build-backend (push) Successful in 1m57s
deploy to production / deploy-frontend (push) Successful in 29s
deploy to production / deploy-backend (push) Failing after 2m24s
Build and test FrontEnd / Build-frontend (push) Successful in 27s

Reviewed-on: #151
Reviewed-by: LeoMoulin <leomoulin125@gmail.com>
Reviewed-by: Wal <karpinskiwal@gmail.com>
Reviewed-by: Maxime <231026@umons.ac.be>
This commit is contained in:
2024-04-17 00:26:11 +02:00
8 changed files with 103 additions and 46 deletions

View File

@ -1,37 +0,0 @@
package ovh.herisson.Clyde;
import javax.sql.DataSource;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;
import org.springframework.jdbc.datasource.DriverManagerDataSource;
import org.springframework.scheduling.annotation.EnableScheduling;
@Configuration
@EnableScheduling
public class JdbcConfig {
@Bean
@Profile("!prod")
public DataSource psqlSource(){
DriverManagerDataSource source = new DriverManagerDataSource();
source.setDriverClassName("org.postgresql.Driver");
source.setUrl("jdbc:postgresql://localhost:5442/clyde");
source.setUsername("devel");
source.setPassword("devel");
return source;
}
@Bean
@Profile("prod")
public DataSource psqlSourceProd(){
DriverManagerDataSource source = new DriverManagerDataSource();
source.setDriverClassName("org.postgresql.Driver");
source.setUrl("jdbc:postgresql:clyde?socketFactory=org.newsclub.net.unix.AFUNIXSocketFactory$FactoryArg&socketFactoryArg=/var/run/postgresql/.s.PGSQL.5432");
source.setUsername("clyde");
return source;
}
}

View File

@ -1,3 +1,12 @@
spring.jpa.hibernate.ddl-auto=create-drop
spring.jpa.database-platform=org.hibernate.dialect.PostgreSQLDialect
spring.sql.init.mode=always
spring.sql.init.mode=always
# spring.datasource.url=jdbc:postgresql://localhost:5442/clyde
spring.datasource.url=jdbc:postgresql://db:5432/clyde
spring.datasource.username=devel
spring.datasource.password=devel
# spring.config.activate.on-profile=prod
# spring.datasource.url=jdbc:postgresql:clyde?socketFactory=org.newsclub.net.unix.AFUNIXSocketFactory$FactoryArg&socketFactoryArg=/var/run/postgresql/.s.PGSQL.5432
# spring.datasource.username=clyde