Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions docker-compose-prod/docker-compose.frontend.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
services:
frontend:
container_name: frontend-prod
build:
dockerfile: ../frontend/Dockerfile
context: ../frontend
image: frontend:1.0.0
ports:
- "5173:80"
4 changes: 2 additions & 2 deletions docker-compose-prod/docker-compose.housing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ services:
depends_on:
- db-housing
- rabbitmq
ports:
- "8088:8080"
expose:
- "8080"

db-housing:
container_name: db-housing-prod
Expand Down
2 changes: 1 addition & 1 deletion docker-compose-prod/docker-compose.notification.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ services:

SPRING_PROFILES_ACTIVE: prod
ports:
- "8087:8080"
- "8095:8080"
depends_on:
- db-notification
- rabbitmq
Expand Down
1 change: 1 addition & 0 deletions docker-compose.prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ include:
- ./docker-compose-prod/docker-compose.gateway.yml
- ./docker-compose-prod/docker-compose.consul.yml
- ./docker-compose-prod/docker-compose.notification.yml
- ./docker-compose-prod/docker-compose.frontend.yml

networks:
default:
Expand Down
1 change: 1 addition & 0 deletions frontend/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
./node_modules
14 changes: 14 additions & 0 deletions frontend/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM node:22-alpine AS builder
WORKDIR /app
COPY . .
RUN npm ci
RUN npm run build

# ---------- runtime stage ----------
FROM nginx:stable-alpine
RUN rm -rf /usr/share/nginx/html/*
COPY --from=builder /app/dist /usr/share/nginx/html
COPY nginx.conf /etc/nginx/conf.d/default.conf

EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]
11 changes: 11 additions & 0 deletions frontend/nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
server {
listen 80;
server_name _;

root /usr/share/nginx/html;
index index.html;

location / {
try_files $uri $uri/ /index.html;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public SecurityConfig(JwtAuthenticationFilter jwtFilter) {
public SecurityWebFilterChain securityWebFilterChain(ServerHttpSecurity http) {
return http
.csrf(ServerHttpSecurity.CsrfSpec::disable)
.cors(ServerHttpSecurity.CorsSpec::disable)
.authorizeExchange(exchanges -> exchanges
.pathMatchers("/api/auth/**").permitAll()
// endpoints use code
Expand Down