diff --git a/Dockerfile b/Dockerfile index 5ccb965..7de3ece 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,13 +1,15 @@ # Stage 1: Build -FROM node:20-alpine AS builder +FROM node:22-alpine AS builder WORKDIR /app COPY package*.json pnpm-lock.yaml ./ RUN npm install -g pnpm && pnpm install COPY . . RUN pnpm run build +# Stage 2: Serve # Stage 2: Serve FROM nginx:alpine COPY --from=builder /app/dist /usr/share/nginx/html -EXPOSE 80 +COPY nginx.conf /etc/nginx/conf.d/default.conf +EXPOSE 3000 CMD ["nginx", "-g", "daemon off;"] \ No newline at end of file diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..bd197d0 --- /dev/null +++ b/nginx.conf @@ -0,0 +1,12 @@ +server { + listen 3000; + root /usr/share/nginx/html; + index index.html; + + location / { + try_files $uri $uri/ /index.html; + } + + gzip on; + gzip_types text/css application/javascript application/json; +} \ No newline at end of file