diff options
Diffstat (limited to 'samples/test.dockerfile')
| -rw-r--r-- | samples/test.dockerfile | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/samples/test.dockerfile b/samples/test.dockerfile new file mode 100644 index 0000000..28f71fd --- /dev/null +++ b/samples/test.dockerfile @@ -0,0 +1,34 @@ +# -------------------- +# Build stage +# -------------------- +FROM node:20-alpine AS build + +# Set working directory +WORKDIR /app + +# Copy dependency files first (better caching) +COPY package.json package-lock.json ./ + +# Install dependencies +RUN npm ci + +# Copy the rest of the source code +COPY . . + +# Build the app +RUN npm run build + + +# -------------------- +# Production stage +# -------------------- +FROM nginx:alpine + +# Copy built files from build stage +COPY --from=build /app/dist /usr/share/nginx/html + +# Expose port 80 +EXPOSE 80 + +# Start nginx +CMD ["nginx", "-g", "daemon off;"] |
