Adding a dockerfile

This commit is contained in:
2025-09-29 15:23:47 +02:00
parent 93db0b1d35
commit 64bdf3189c

33
Dockerfile Normal file
View File

@ -0,0 +1,33 @@
# Use Node.js LTS as base image
FROM node:20-alpine
# Set working directory
WORKDIR /app
# Install git and pnpm
RUN apk add --no-cache git
RUN npm install -g pnpm
# Clone the repository
RUN git clone https://git.raphaelforment.fr/BuboBubo/coolsoup.git .
# Install dependencies
RUN pnpm install
# Build the application
RUN pnpm build
# Use nginx to serve the built application
FROM nginx:alpine
# Copy built files from previous stage
COPY --from=0 /app/dist /usr/share/nginx/html
# Copy nginx configuration if needed (optional)
# COPY nginx.conf /etc/nginx/nginx.conf
# Expose port 80
EXPOSE 80
# Start nginx
CMD ["nginx", "-g", "daemon off;"]