Compare commits

..

No commits in common. "d3adfa5cb20e80de72f69fb27ecf811324044ac7" and "5e3c6367c2737aad1194ee5901cd72bab6e46323" have entirely different histories.

2 changed files with 19 additions and 30 deletions

View File

@ -1,36 +1,25 @@
FROM node:18-alpine AS build
FROM node:18-alpine
RUN mkdir -p /app
WORKDIR /app
# Copy package files first for better layer caching
COPY package.json package-lock.json* ./
COPY package.json ./
# Install dependencies
RUN npm ci
RUN npm install
RUN npm install --save-dev
COPY . /app
# Build the Next.js app
RUN npm run build
# Expose the port the app will run on
EXPOSE 3000
# Copy the rest of the application
COPY . .
# Build the application
RUN npm run build
# Production stage
FROM node:18-alpine AS production
WORKDIR /app
# Copy only the built assets and necessary files from the build stage
COPY --from=build /app/dist ./dist
COPY --from=build /app/package.json ./
# Install only production dependencies
RUN npm ci --omit=dev
# Expose the port Vite uses by default
EXPOSE 5173
# Use a static file server for production builds
RUN npm install -g serve
# Serve the built application
CMD ["serve", "-s", "dist", "-l", "5173"]
CMD ["npm", "run", "dev"]

View File

@ -6,7 +6,7 @@ services:
container_name: healthy-oil
ports:
- "3005:5173"
- "3005:3000"
volumes:
- .:/app
- /app/node_modules