Skip to content

Commit 5efc432

Browse files
Deploying test (#10)
* Use explicit build contexts and Dockerfiles Update examples/docker-compose.yml to set explicit build contexts and Dockerfile paths for backend and frontend services so they build correctly from the repository root. This ensures Docker uses the example subdirectories as the build context rather than the compose file location. * Use ./ paths for docker build contexts Update examples/docker-compose.yml to use './backend' and './frontend' as the build contexts instead of 'examples/backend' and 'examples/frontend'. This makes the paths relative to the compose file and aligns the compose configuration with the repository layout. * Move docker-compose.yml to root and update contexts Rename examples/docker-compose.yml to docker-compose.yml and update the Docker build contexts to examples/backend and examples/frontend. Ports and VITE_BACKEND_URL arg are unchanged. This centralizes the compose file at the repository root and corrects paths after the move. * Use origin patterns wildcard in CORS config Replace explicit allowed origins with setAllowedOriginPatterns(List.of("*")) to allow wildcard origins. This simplifies CORS for the demo backend (supports dynamic/dev hosts) and is compatible with allowCredentials; other CORS settings remain unchanged.
1 parent 1becac1 commit 5efc432

3 files changed

Lines changed: 10 additions & 6 deletions

File tree

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
services:
22
backend:
3-
build: ./backend
3+
build:
4+
context: examples/backend
5+
dockerfile: Dockerfile
46
ports:
57
- "11006:11006"
68

79
frontend:
810
build:
9-
context: ./frontend
11+
context: examples/frontend
12+
dockerfile: Dockerfile
1013
args:
1114
VITE_BACKEND_URL: ${VITE_BACKEND_URL:-http://localhost:11006}
1215
ports:

examples/backend/src/main/java/com/davidrandoll/webcaptor/demo/config/CorsConfig.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,14 @@
1010

1111
import java.util.List;
1212

13+
// Demo environment only — permissive CORS is fine here
1314
@Configuration
1415
public class CorsConfig {
1516

1617
@Bean
1718
public FilterRegistrationBean<CorsFilter> corsFilterRegistration() {
1819
CorsConfiguration config = new CorsConfiguration();
19-
config.setAllowedOrigins(List.of("http://localhost:5173", "http://localhost:3000"));
20+
config.setAllowedOriginPatterns(List.of("*"));
2021
config.setAllowedMethods(List.of("*"));
2122
config.setAllowedHeaders(List.of("*"));
2223
config.setAllowCredentials(true);

examples/frontend/package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)