Adding a dockerfile
This commit is contained in:
33
Dockerfile
Normal file
33
Dockerfile
Normal 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;"]
|
||||||
Reference in New Issue
Block a user