diff --git a/docker-compose.yml b/docker-compose.yml index 2dbfb36..5f5cce0 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -28,14 +28,22 @@ services: - "3306:3306" nginx: - image: nginx:latest container_name: nginx-proxy + image: nginx:latest volumes: - - ./nginx/conf.d:/etc/nginx/conf.d - - /etc/letsencrypt:/etc/letsencrypt + - ./data/nginx:/etc/nginx/conf.d + - ./data/certbot/conf:/etc/letsencrypt + - ./data/certbot/www:/var/www/certbot ports: - "80:80" - "443:443" depends_on: - - app - restart: always + - certbot + + certbot: + image: certbot/certbot + container_name: certbot + volumes: + - ./data/certbot/conf:/etc/letsencrypt + - ./data/certbot/www:/var/www/certbot + entrypoint: "/bin/sh -c 'trap exit TERM; while :; do certbot renew; sleep 12h & wait $${!}; done;'" diff --git a/src/main/java/com/example/SucceSS/config/CorsConfig.java b/src/main/java/com/example/SucceSS/config/CorsConfig.java index 9309daa..6758940 100644 --- a/src/main/java/com/example/SucceSS/config/CorsConfig.java +++ b/src/main/java/com/example/SucceSS/config/CorsConfig.java @@ -14,8 +14,9 @@ public class CorsConfig { public static CorsConfigurationSource corsConfigurationSource() { CorsConfiguration config = new CorsConfiguration(); config.setAllowCredentials(true); - config.setAllowedOrigins(List.of("http://localhost:5173")); - config.setAllowedOrigins(List.of("https://how-was-your-day.vercel.app/oauth")); + config.setAllowedOrigins(List.of( + "http://localhost:5173", + "https://how-was-your-day.vercel.app")); config.setAllowedMethods(List.of("GET", "POST", "PUT", "DELETE", "PATCH", "OPTIONS")); config.setAllowedHeaders(List.of("*")); config.setExposedHeaders(List.of("*")); diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index eec06f6..e71d6cb 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -21,4 +21,6 @@ logging.level.org.springframework.security=DEBUG logging.level.org.springframework.web=DEBUG # hugging face -spring.huggingface.api.url=${HUGGINGFACE_API_URL} \ No newline at end of file +spring.huggingface.api.url=${HUGGINGFACE_API_URL} + +spring.web.resources.static-locations=classpath:/static/, file:./src/main/resources/static/