Update Dockerfile and vite.config.ts

This commit is contained in:
Dede Fuji Abdul 2024-02-28 16:53:14 +07:00
parent 771b8a0a9f
commit d4bdb8cf7b
2 changed files with 17 additions and 17 deletions

View File

@ -1,18 +1,18 @@
FROM node:lts-alpine as build-stage # FROM node:lts-alpine as build-stage
WORKDIR /app # WORKDIR /app
COPY package*.json ./ # COPY package*.json ./
RUN npm install # RUN npm install
COPY . . # COPY . .
RUN npm run build # RUN npm run build
FROM nginx:stable-alpine as production-stage # FROM nginx:stable-alpine as production-stage
COPY --from=build-stage /app/build /usr/share/nginx/html # COPY --from=build-stage /app/build /usr/share/nginx/html
COPY --from=build-stage /app/nginx.conf /etc/nginx/nginx.conf # COPY --from=build-stage /app/nginx.conf /etc/nginx/nginx.conf
EXPOSE 32166
CMD ["nginx", "-g", "daemon off;"]
# FROM nginx:stable-alpine
# COPY /dist /usr/share/nginx/html
# COPY /nginx.conf /etc/nginx/nginx.conf
# EXPOSE 32166 # EXPOSE 32166
# CMD ["nginx", "-g", "daemon off;"] # CMD ["nginx", "-g", "daemon off;"]
FROM nginx:stable-alpine
COPY /build /usr/share/nginx/html
COPY /nginx.conf /etc/nginx/nginx.conf
EXPOSE 32166
CMD ["nginx", "-g", "daemon off;"]

View File

@ -25,7 +25,7 @@ export default defineConfig({
outDir: 'build', outDir: 'build',
emptyOutDir: true, emptyOutDir: true,
chunkSizeWarningLimit: 4096, chunkSizeWarningLimit: 4096,
cssCodeSplit: true, // cssCodeSplit: true,
cssMinify: true, // cssMinify: true,
} }
}) })