-
Notifications
You must be signed in to change notification settings - Fork 1
Feature/docker config update #19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
1507c79
ad3615b
3e18fab
6438a82
1b4142b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| node_modules | ||
| npm-debug.log | ||
| .git | ||
| .gitignore | ||
| .env | ||
| .env.local | ||
| .env.development.local | ||
| .env.test.local | ||
| .env.production.local | ||
| dist | ||
| coverage | ||
| .nyc_output | ||
| .DS_Store | ||
| *.log |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| # Build stage | ||
| FROM node:18-alpine AS builder | ||
|
|
||
| WORKDIR /app | ||
|
|
||
| # Copy package files | ||
| COPY package*.json ./ | ||
|
|
||
| # Install dependencies | ||
| RUN npm ci | ||
|
|
||
| # Copy source code | ||
| COPY . . | ||
|
|
||
| # Build the application | ||
| RUN npx vite build | ||
|
|
||
| # Production stage | ||
| FROM node:18-alpine | ||
|
|
||
| # Install serve globally | ||
| RUN npm install -g serve | ||
|
|
||
| # Copy built files from builder stage | ||
| COPY --from=builder /app/dist /app/dist | ||
|
|
||
| # Set working directory | ||
| WORKDIR /app | ||
|
|
||
| # Expose port 80 | ||
| EXPOSE 80 | ||
|
|
||
| # Start serve with SPA support | ||
| CMD ["serve", "-s", "dist", "-l", "80", "--single"] | ||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -27,9 +27,9 @@ public RestTemplate restTemplate() { | |||||
|
|
||||||
| @Override | ||||||
| public void addCorsMappings(CorsRegistry registry) { | ||||||
| registry.addMapping("/api/**") | ||||||
| .allowedOriginPatterns("*") // Allow all origins in development environment | ||||||
| .allowedMethods("GET", "POST", "PUT", "DELETE", "OPTIONS","PATCH") | ||||||
| registry.addMapping("/**") | ||||||
| .allowedOriginPatterns("*") | ||||||
| .allowedMethods("*") | ||||||
|
||||||
| .allowedMethods("*") | |
| .allowedMethods("GET", "POST", "PUT", "DELETE", "OPTIONS", "PATCH") |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -15,27 +15,58 @@ spring: | |||||
| # JPA Configuration | ||||||
| jpa: | ||||||
| hibernate: | ||||||
| ddl-auto: create-drop | ||||||
| ddl-auto: validate | ||||||
|
||||||
| ddl-auto: validate | |
| ddl-auto: none |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.