Feature/docker config update#19
Conversation
- remove initialization SQL path - update OLLAMA environment variables - add new Admin UI service - change JPA settings - add Flyway and Elasticsearch configurations - update Ollama and Unstructured API settings
- Create multi-stage Dockerfile for admin UI - Add .dockerignore to exclude unnecessary files
- Enable CORS for all paths - Allow all HTTP methods
- Remove Docker profile and related configurations for database, Elasticsearch, Ollama, MinIO, and Unstructured.io
There was a problem hiding this comment.
Pull Request Overview
This PR refactors Docker configuration to improve service setup and connectivity by removing environment variable overrides from docker-compose.yml and consolidating configuration into profile-specific files. The changes introduce a new Admin UI service and update application configuration structure.
- Remove environment variable duplication by leveraging Spring profiles instead of docker-compose overrides
- Add Admin UI service with multi-stage Docker build for production optimization
- Update JPA settings from
create-droptovalidateand add Flyway migration support
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| docker-compose.yml | Remove init SQL volume mount, environment variable overrides, and add Admin UI service |
| core/src/main/resources/application.yml | Remove Docker-specific configuration block (moved to docker profile) |
| core/src/main/resources/application-docker.yml | Update JPA settings, add Flyway config, and restructure application properties |
| core/src/main/java/com/opencontext/config/WebConfig.java | Expand CORS to allow all paths and HTTP methods |
| admin-ui/Dockerfile | Add multi-stage build with Node.js for production deployment |
| admin-ui/.dockerignore | Add standard Node.js exclusions for Docker builds |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| jpa: | ||
| hibernate: | ||
| ddl-auto: create-drop | ||
| ddl-auto: validate |
There was a problem hiding this comment.
Changing from 'create-drop' to 'validate' requires existing database schema to match entity definitions. This change should be coordinated with proper database migration strategy to avoid runtime failures.
| ddl-auto: validate | |
| ddl-auto: none |
| .allowedMethods("GET", "POST", "PUT", "DELETE", "OPTIONS","PATCH") | ||
| registry.addMapping("/**") | ||
| .allowedOriginPatterns("*") | ||
| .allowedMethods("*") |
There was a problem hiding this comment.
Allowing all HTTP methods (*) in CORS configuration may expose unintended endpoints to cross-origin requests. Consider explicitly listing only the required methods (GET, POST, PUT, DELETE, OPTIONS, PATCH).
| .allowedMethods("*") | |
| .allowedMethods("GET", "POST", "PUT", "DELETE", "OPTIONS", "PATCH") |
| EXPOSE 80 | ||
|
|
||
| # Start serve with SPA support | ||
| CMD ["serve", "-s", "dist", "-l", "80", "--single"] |
There was a problem hiding this comment.
The production stage uses a full Node.js image but only needs the 'serve' package. Consider using a lighter base image like nginx:alpine for better security and smaller image size.
| CMD ["serve", "-s", "dist", "-l", "80", "--single"] | |
| FROM nginx:alpine | |
| # Copy built files from builder stage to nginx's static directory | |
| COPY --from=builder /app/dist /usr/share/nginx/html | |
| # Expose port 80 | |
| EXPOSE 80 |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Overview
Update Docker and application configurations and add Admin UI to ensure smooth service setup and proper connections between services.
Key Changes
docker-compose.yml.dockerignoreapplication-docker.ymlunstructured.base-url→app.unstructured.api.url)application.yml