Compare commits
No commits in common. "d3adfa5cb20e80de72f69fb27ecf811324044ac7" and "5e3c6367c2737aad1194ee5901cd72bab6e46323" have entirely different histories.
d3adfa5cb2
...
5e3c6367c2
47
Dockerfile
47
Dockerfile
|
@ -1,36 +1,25 @@
|
||||||
FROM node:18-alpine AS build
|
|
||||||
|
FROM node:18-alpine
|
||||||
|
|
||||||
|
RUN mkdir -p /app
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# Copy package files first for better layer caching
|
COPY package.json ./
|
||||||
COPY package.json package-lock.json* ./
|
|
||||||
|
|
||||||
# Install dependencies
|
RUN npm install
|
||||||
RUN npm ci
|
|
||||||
|
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 . .
|
COPY . .
|
||||||
|
|
||||||
# Build the application
|
CMD ["npm", "run", "dev"]
|
||||||
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"]
|
|
|
@ -6,7 +6,7 @@ services:
|
||||||
container_name: healthy-oil
|
container_name: healthy-oil
|
||||||
|
|
||||||
ports:
|
ports:
|
||||||
- "3005:5173"
|
- "3005:3000"
|
||||||
volumes:
|
volumes:
|
||||||
- .:/app
|
- .:/app
|
||||||
- /app/node_modules
|
- /app/node_modules
|
||||||
|
|
Loading…
Reference in New Issue