....
This commit is contained in:
@@ -9,7 +9,7 @@ RUN npm run build
|
|||||||
# 2단계: 실행 (Nginx)
|
# 2단계: 실행 (Nginx)
|
||||||
FROM nginx:stable-alpine
|
FROM nginx:stable-alpine
|
||||||
# 빌드된 파일들을 Nginx의 기본 경로로 복사
|
# 빌드된 파일들을 Nginx의 기본 경로로 복사
|
||||||
COPY --from=build /app/dist /usr/share/nginx/html
|
COPY --from=build /app/dist /usr/share/nginx/html/ftp
|
||||||
# (선택) 커스텀 nginx 설정을 넣고 싶다면 아래 주석 해제
|
# (선택) 커스텀 nginx 설정을 넣고 싶다면 아래 주석 해제
|
||||||
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
|
|||||||
11
nginx.conf
11
nginx.conf
@@ -11,12 +11,11 @@ server {
|
|||||||
gzip_proxied expired no-cache no-store private auth;
|
gzip_proxied expired no-cache no-store private auth;
|
||||||
gzip_types text/plain text/css application/json application/javascript application/x-javascript text/xml application/xml application/xml+rss text/javascript;
|
gzip_types text/plain text/css application/json application/javascript application/x-javascript text/xml application/xml application/xml+rss text/javascript;
|
||||||
|
|
||||||
location / {
|
location /ftp/ {
|
||||||
try_files $uri $uri/ /index.html;
|
alias /usr/share/nginx/html/ftp/;
|
||||||
|
try_files $uri $uri/ /ftp/index.html;
|
||||||
}
|
}
|
||||||
|
|
||||||
# Handle assets correctly to avoid fallback to index.html for missing files
|
# Handle assets explicitly if needed, but the above generic rule covers it if files exist
|
||||||
location /assets/ {
|
# If the user requests /ftp/assets/..., the alias maps it to /usr/share/nginx/html/ftp/assets/...
|
||||||
try_files $uri =404;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import react from '@vitejs/plugin-react';
|
|||||||
export default defineConfig(({ mode }) => {
|
export default defineConfig(({ mode }) => {
|
||||||
const env = loadEnv(mode, '.', '');
|
const env = loadEnv(mode, '.', '');
|
||||||
return {
|
return {
|
||||||
base: './',
|
base: '/ftp/',
|
||||||
server: {
|
server: {
|
||||||
port: 3000,
|
port: 3000,
|
||||||
host: '0.0.0.0',
|
host: '0.0.0.0',
|
||||||
|
|||||||
Reference in New Issue
Block a user