🔨 Update bunjs dockerfile, provide nodejs version dockerfile
This commit is contained in:
33
Dockerfile.node
Normal file
33
Dockerfile.node
Normal file
@@ -0,0 +1,33 @@
|
||||
# Stage 1: Build the application
|
||||
FROM node:20 as builder
|
||||
WORKDIR /app
|
||||
|
||||
# Copy dependency definition files
|
||||
COPY package.json ./
|
||||
COPY package-lock.json ./
|
||||
|
||||
# Install dependencies
|
||||
RUN npm install
|
||||
|
||||
# Copy the rest of the application code
|
||||
COPY . .
|
||||
|
||||
# Build the Nuxt application
|
||||
RUN npm run build
|
||||
|
||||
# Stage 2: Create the production image
|
||||
FROM node:20-slim as runner
|
||||
WORKDIR /app
|
||||
|
||||
# Copy the built output from the builder stage
|
||||
COPY --from=builder /app/.output ./.output
|
||||
|
||||
# Set environment variables for the Nuxt server
|
||||
ENV HOST=0.0.0.0
|
||||
ENV PORT=3000
|
||||
|
||||
# Expose the port the app runs on
|
||||
EXPOSE 3000
|
||||
|
||||
# The command to run the application
|
||||
CMD ["node", ".output/server/index.mjs"]
|
||||
Reference in New Issue
Block a user