remove nginx
This commit is contained in:
parent
fa3e0284af
commit
b4050c3684
25
Dockerfile
25
Dockerfile
@ -1,35 +1,30 @@
|
|||||||
# Build stage
|
# Build stage
|
||||||
FROM node:20-alpine AS builder
|
FROM node:20-alpine AS builder
|
||||||
|
|
||||||
# Set working directory
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# Copy package files
|
|
||||||
COPY package.json pnpm-lock.yaml ./
|
COPY package.json pnpm-lock.yaml ./
|
||||||
|
|
||||||
# Install pnpm
|
|
||||||
RUN npm install -g pnpm
|
RUN npm install -g pnpm
|
||||||
|
|
||||||
# Install dependencies
|
|
||||||
RUN pnpm install --frozen-lockfile
|
RUN pnpm install --frozen-lockfile
|
||||||
|
|
||||||
# Copy source code
|
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
# Build the application
|
ARG GEMINI_API_KEY
|
||||||
|
ENV VITE_GEMINI_API_KEY=${GEMINI_API_KEY}
|
||||||
|
|
||||||
RUN pnpm run build
|
RUN pnpm run build
|
||||||
|
|
||||||
# Production stage
|
# Production stage
|
||||||
FROM nginx:alpine
|
FROM node:20-alpine
|
||||||
|
|
||||||
# Copy built assets from builder stage
|
WORKDIR /app
|
||||||
COPY --from=builder /app/dist /usr/share/nginx/html
|
|
||||||
|
|
||||||
# Copy nginx configuration
|
RUN npm install -g serve
|
||||||
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
|
||||||
|
|
||||||
# Expose port 80
|
COPY --from=builder /app/dist ./dist
|
||||||
EXPOSE 80
|
|
||||||
|
|
||||||
# Start nginx
|
EXPOSE 3033
|
||||||
CMD ["nginx", "-g", "daemon off;"]
|
|
||||||
|
CMD ["serve", "-s", "dist", "-l", "3033"]
|
||||||
|
|||||||
@ -9,7 +9,7 @@ services:
|
|||||||
- GEMINI_API_KEY=${GEMINI_API_KEY}
|
- GEMINI_API_KEY=${GEMINI_API_KEY}
|
||||||
container_name: pradit-prod
|
container_name: pradit-prod
|
||||||
ports:
|
ports:
|
||||||
- "3033:80"
|
- "3033:3033"
|
||||||
environment:
|
environment:
|
||||||
- NODE_ENV=production
|
- NODE_ENV=production
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user